Update CI auto-format by YashSuthar983 · Pull Request #6233 · RustPython/RustPython
1-6: Trigger configuration looks good.
The workflow correctly responds to CI completion and supports manual dispatch.
10-24: Job configuration is appropriate.
Permissions correctly scoped for git commits and PR comments; concurrency setup prevents redundant runs.
27-32: Checkout configuration correct for workflow_run context.
Properly references github.event.workflow_run context to check out the PR head branch and repository.
34-37: Rust toolchain setup is standard.
Using dtolnay's stable toolchain with rustfmt component is the recommended approach.
39-42: Formatting command is correct.
Straightforward cargo fmt --all invocation.
21-21: Verify workflow_dispatch trigger intent—job will be skipped when manually triggered.
The job condition checks github.event.workflow_run.conclusion, which doesn't exist for workflow_dispatch events. This means the job will be skipped if manually triggered via the workflow_dispatch button.
If manual formatting is desired, update the condition to handle both event types:
- if: ${{ github.event.workflow_run.conclusion == 'success' && !contains(github.event.workflow_run.head_commit.message, '[skip ci]') }} + if: ${{ (github.event_name == 'workflow_dispatch') || (github.event.workflow_run.conclusion == 'success' && !contains(github.event.workflow_run.head_commit.message, '[skip ci]')) }}