Skip to content

当前项目还有哪些没实现的 #39

当前项目还有哪些没实现的

当前项目还有哪些没实现的 #39

name: Claude Issue Duplicate Check
on:
issues:
types: [opened]
jobs:
check-duplicate:
if: |
!endsWith(github.actor, '[bot]')
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: false
permissions:
contents: read
issues: write
env:
HAS_ANTHROPIC_KEY: ${{ secrets.ANTHROPIC_API_KEY != '' }}
steps:
- name: Skip (missing ANTHROPIC_API_KEY)
if: env.HAS_ANTHROPIC_KEY != 'true'
run: echo "ANTHROPIC_API_KEY is not configured; skipping duplicate check."
- name: Checkout repository
if: env.HAS_ANTHROPIC_KEY == 'true'
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Ensure duplicate label exists
if: env.HAS_ANTHROPIC_KEY == 'true'
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
if: env.HAS_ANTHROPIC_KEY == 'true'
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
if: env.HAS_ANTHROPIC_KEY == 'true'
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: "--model ${{ vars.CLAUDE_MODEL || 'claude-sonnet-4-5-20250929' }} --max-turns 30 --allowedTools Bash(*)"
use_commit_signing: false