Auto Fix CI Failures #569
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto Fix CI Failures | |
| # Thin caller for the org-wide reusable workflow in laurigates/.github. | |
| # The local copy this replaced predated that repo and reimplemented, less | |
| # thoroughly, what reusable-auto-fix.yml provides: it had a branch-name loop | |
| # guard but no flood guard and no already-attempted detection, and it drove the | |
| # branch/push/PR-create steps itself. | |
| on: | |
| workflow_run: | |
| workflows: ["Smoke Test CI"] | |
| types: | |
| - completed | |
| # Concurrency is declared by the reusable workflow. The loop guard that used to | |
| # live in this file's `if:` (skip branches named claude-auto-fix-ci-*) is | |
| # superseded by the reusable workflow's own flood guard (max_auto_fix_prs) and | |
| # its "skip if already attempted" step. | |
| jobs: | |
| auto-fix: | |
| if: > | |
| github.event.workflow_run.conclusion == 'failure' && | |
| github.event.workflow_run.pull_requests[0] | |
| uses: laurigates/.github/.github/workflows/reusable-auto-fix.yml@main | |
| with: | |
| branch: ${{ github.event.workflow_run.head_branch }} | |
| run_id: "${{ github.event.workflow_run.id }}" | |
| workflow_name: ${{ github.event.workflow_run.name }} | |
| head_sha: ${{ github.event.workflow_run.head_sha }} | |
| claude_args: --model ${{ vars.CLAUDE_MODEL || 'opus' }} --max-turns 50 | |
| # Repo-specific grants on top of the reusable workflow's built-in set | |
| # (Write/Edit/Grep/Glob/Task/TodoWrite, the git verbs, gh pr/issue/run). | |
| # A dotfiles CI failure is almost always a lint failure, and fixing one | |
| # means re-running the linter to confirm — hence the linters, and chezmoi | |
| # for source-tree validation. | |
| additional_permissions: | | |
| Bash(pre-commit *) | |
| Bash(actionlint *) | |
| Bash(shellcheck *) | |
| Bash(luacheck *) | |
| Bash(gitleaks *) | |
| Bash(chezmoi diff *) | |
| Bash(chezmoi status *) | |
| Bash(mise run lint*) | |
| secrets: | |
| CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |