-
Notifications
You must be signed in to change notification settings - Fork 2.2k
57 lines (51 loc) · 1.75 KB
/
issue-dedupe.yml
File metadata and controls
57 lines (51 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Detects duplicate issues using Claude Code with the /dedupe command.
# Triggered automatically when a new issue is opened, or manually for a single issue.
name: Issue Duplicate Detection
on:
issues:
types: [opened]
workflow_dispatch:
inputs:
issue_number:
description: 'Issue number to check for duplicates'
required: true
type: string
permissions:
contents: read
issues: write
concurrency:
group: dedupe-${{ github.event.issue.number || inputs.issue_number }}
cancel-in-progress: true
jobs:
detect-duplicate:
runs-on: ubuntu-latest
timeout-minutes: 10
# Skip pull-requests that surface as issues and bot-opened issues
if: >
(github.event_name == 'workflow_dispatch') ||
(github.event.issue.pull_request == null &&
!endsWith(github.actor, '[bot]') &&
github.actor != 'github-actions')
steps:
- uses: actions/checkout@v4
- name: Determine issue number
id: issue
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_NUMBER: ${{ inputs.issue_number }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
echo "number=$INPUT_NUMBER" >> "$GITHUB_OUTPUT"
else
echo "number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT"
fi
- uses: anthropics/claude-code-action@v1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prompt: "/dedupe ${{ github.repository }}/issues/${{ steps.issue.outputs.number }}"
anthropic_api_key: ${{ secrets.AUTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
allowed_bots: "github-actions"
allowed_non_write_users: "*"