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: Claude Issue Duplicate Check | ||
|
Check failure on line 1 in .github/workflows/claude-issue-duplicate-check.yml
|
||
| on: | ||
| issues: | ||
| types: [opened] | ||
| jobs: | ||
| check-duplicate: | ||
| if: | | ||
| !endsWith(github.actor, '[bot]') && | ||
| secrets.ANTHROPIC_API_KEY != '' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.issue.number }} | ||
| cancel-in-progress: false | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 1 | ||
| - name: Ensure duplicate label exists | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ github.token }} | ||
| script: | | ||
| const { owner, repo } = context.repo; | ||
| const name = "duplicate"; | ||
| try { | ||
| await github.rest.issues.getLabel({ owner, repo, name }); | ||
| return; | ||
| } catch (e) { | ||
| if (e.status !== 404) throw e; | ||
| } | ||
| try { | ||
| await github.rest.issues.createLabel({ | ||
| owner, | ||
| repo, | ||
| name, | ||
| color: "cfd3d7", | ||
| description: "Duplicate issue", | ||
| }); | ||
| } catch (e) { | ||
| if (e.status !== 422) throw e; | ||
| } | ||
| - name: Load prompt | ||
| id: prompt | ||
| shell: bash | ||
| run: | | ||
| { | ||
| echo "prompt<<'EOF'" | ||
| cat .github/prompts/claude-issue-duplicate-check.md | ||
| echo "EOF" | ||
| } >> "$GITHUB_OUTPUT" | ||
| - name: Run Claude duplicate check | ||
| uses: anthropics/claude-code-action@v1 | ||
| env: | ||
| ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
| GH_TOKEN: ${{ github.token }} | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }} | ||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| github_token: ${{ github.token }} | ||
| allowed_non_write_users: "*" | ||
| prompt: ${{ steps.prompt.outputs.prompt }} | ||
| claude_args: "--max-turns 30 --allowedTools Bash(*)" | ||
| use_commit_signing: false | ||