Skip to content

feat: add output-file input for clean isort logging#111

Draft
jmchilton wants to merge 1 commit intoisort:masterfrom
jmchilton:feat/output-file-support
Draft

feat: add output-file input for clean isort logging#111
jmchilton wants to merge 1 commit intoisort:masterfrom
jmchilton:feat/output-file-support

Conversation

@jmchilton
Copy link
Copy Markdown

Summary

Add optional output-file input to write isort output to a file in addition to stdout. This allows GitHub Actions workflows to capture structured isort output without cluttering job logs.

Changes

  • New output-file input parameter (optional, default: empty string)
  • Output written to file relative to repo root when specified
  • Full stdout/log output preserved - file write is in addition to, not instead of
  • Exit code and behavior unchanged

Rationale

When using isort with --check-only --diff in CI, output lands in GitHub Actions logs making them difficult to parse. This feature enables:

  • Uploading output as artifacts for programmatic analysis
  • Keeping logs clean while preserving full isort results
  • Integration with downstream tools like LLM analysis pipelines

Example Usage

  - uses: isort/isort-action@v1
    with:
      output-file: isort-output.txt

  - uses: actions/upload-artifact@v4
    if: failure()
    with:
      name: isort report
      path: isort-output.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant