summaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/duplicate-prs.yml52
1 files changed, 52 insertions, 0 deletions
diff --git a/.github/workflows/duplicate-prs.yml b/.github/workflows/duplicate-prs.yml
new file mode 100644
index 000000000..50d26c522
--- /dev/null
+++ b/.github/workflows/duplicate-prs.yml
@@ -0,0 +1,52 @@
+name: Duplicate PR Check
+
+on:
+ pull_request:
+ types: [opened]
+
+jobs:
+ check-duplicates:
+ if: |
+ github.event.pull_request.user.login != 'actions-user' &&
+ github.event.pull_request.user.login != 'opencode' &&
+ github.event.pull_request.user.login != 'rekram1-node' &&
+ github.event.pull_request.user.login != 'thdxr' &&
+ github.event.pull_request.user.login != 'kommander' &&
+ github.event.pull_request.user.login != 'jayair' &&
+ github.event.pull_request.user.login != 'fwang' &&
+ github.event.pull_request.user.login != 'adamdotdevin' &&
+ github.event.pull_request.user.login != 'iamdavidhill' &&
+ github.event.pull_request.user.login != 'opencode-agent[bot]'
+ runs-on: blacksmith-4vcpu-ubuntu-2404
+ permissions:
+ contents: read
+ pull-requests: write
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 1
+
+ - name: Setup Bun
+ uses: ./.github/actions/setup-bun
+
+ - name: Install opencode
+ run: curl -fsSL https://opencode.ai/install | bash
+
+ - name: Check for duplicate PRs
+ env:
+ OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ PR_TITLE: ${{ github.event.pull_request.title }}
+ PR_BODY: ${{ github.event.pull_request.body }}
+ run: |
+ COMMENT=$(opencode run --agent duplicate-pr --print "Check for duplicate PRs related to this new PR:
+
+ Title: $PR_TITLE
+
+ Description: $PR_BODY")
+
+ gh pr comment "$PR_NUMBER" --body "_The following comment was made by an LLM, it may be inaccurate:_
+
+ $COMMENT"