Skip to content

Commit 7da6d7a

Browse files
committed
Restrict auto-fix to PR branches only [auto-fix]
Add explicit checks to ensure the workflow doesn't run on main/master branches, only on PR branches from Claude.
1 parent 09c6b3c commit 7da6d7a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/auto-fix-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ jobs:
1717
auto-fix:
1818
# Only run when:
1919
# 1. The Validate workflow failed
20-
# 2. There is an associated PR
20+
# 2. There is an associated PR (not main/master branch)
2121
# 3. The branch was created by Claude (starts with 'claude/')
2222
if: |
2323
github.event.workflow_run.conclusion == 'failure' &&
2424
github.event.workflow_run.pull_requests[0] &&
25+
github.event.workflow_run.head_branch != 'main' &&
26+
github.event.workflow_run.head_branch != 'master' &&
2527
startsWith(github.event.workflow_run.head_branch, 'claude/')
2628
runs-on: ubuntu-latest
2729
steps:

0 commit comments

Comments
 (0)