Skip to content

Commit 1a759f0

Browse files
committed
feat: skip fixer job if fix already exists
1 parent 4039044 commit 1a759f0

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/claude-fixer.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,27 @@ jobs:
1919
echo "runner=ubuntu-latest" >> $GITHUB_OUTPUT
2020
fi
2121
22-
fix-on-failure:
22+
check-existing-pr:
23+
runs-on: ubuntu-latest
2324
needs: determine-runner
25+
outputs:
26+
skip: ${{ steps.check.outputs.skip }}
27+
steps:
28+
- id: check
29+
env:
30+
GH_TOKEN: ${{ github.token }}
31+
run: |
32+
BRANCH="${{ github.event.workflow_run.head_branch }}"
33+
COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --head "fix/claude-auto-" --base "$BRANCH" --state open --json number --jq 'length')
34+
if [ "${COUNT:-0}" -gt 0 ]; then
35+
echo "skip=true" >> $GITHUB_OUTPUT
36+
else
37+
echo "skip=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
fix-on-failure:
41+
needs: [determine-runner, check-existing-pr]
42+
if: needs.check-existing-pr.outputs.skip == 'false'
2443
runs-on: ${{ needs.determine-runner.outputs.runner }}
2544
permissions:
2645
contents: write

0 commit comments

Comments
 (0)