-
Notifications
You must be signed in to change notification settings - Fork 70
ci: format and auto-commit diffs instead of just checking #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,10 +44,16 @@ jobs: | |
| format: | ||
| name: Format | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.head_ref }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
|
|
@@ -65,8 +71,15 @@ jobs: | |
| - name: Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: Run format check | ||
| run: bunx biome ci --formatter-enabled=true --assist-enabled=true --linter-enabled=false --reporter=github . | ||
| - name: Run formatter | ||
| run: bun run format | ||
|
|
||
| - name: Commit formatting changes | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Agentic Security Review |
||
| with: | ||
| commit_message: "style: apply biome formatting" | ||
| commit_user_name: "github-actions[bot]" | ||
| commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| knip: | ||
| name: Knip | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new job-level condition restricts
formatto same-repo PRs only, so fork PRs now skip formatting entirely. In GitHub Actions, a skipped job is treated as successful for required checks, which means external contributions can merge without any formatter validation. If auto-commit is only intended for same-repo branches, keep the formatter step running for all PRs and gate only the commit step behind the same-repo condition.Useful? React with 👍 / 👎.