summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorDax <[email protected]>2025-08-12 11:39:39 -0400
committerGitHub <[email protected]>2025-08-12 11:39:39 -0400
commit10735f93ca97a1a9eedc3a245ab627bd00e72082 (patch)
tree9cc7718f9819fa61efeaa18e35dee7971f73b371 /.github/workflows
parentccaebdcd16438d0ede6291d3b4f82e19e0143610 (diff)
downloadopencode-10735f93ca97a1a9eedc3a245ab627bd00e72082.tar.gz
opencode-10735f93ca97a1a9eedc3a245ab627bd00e72082.zip
Add agent-level permissions with whitelist/blacklist support (#1862)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/duplicate-issues.yml50
-rw-r--r--.github/workflows/guidelines-check.yml49
2 files changed, 99 insertions, 0 deletions
diff --git a/.github/workflows/duplicate-issues.yml b/.github/workflows/duplicate-issues.yml
index e69de29bb..ba9577dbb 100644
--- a/.github/workflows/duplicate-issues.yml
+++ b/.github/workflows/duplicate-issues.yml
@@ -0,0 +1,50 @@
+name: Duplicate Issue Detection
+
+on:
+ issues:
+ types: [opened]
+
+jobs:
+ check-duplicates:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ issues: write
+ id-token: write
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 1
+
+ - name: Install opencode
+ run: curl -fsSL https://opencode.ai/install | bash
+
+ - name: Check for duplicate issues
+ env:
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ opencode run --agent github -m anthropic/claude-sonnet-4-20250514 "A new issue has been created: '${{ github.event.issue.title }}'
+
+ Issue body:
+ ${{ github.event.issue.body }}
+
+ Please search through existing issues in this repository to find any potential duplicates of this new issue. Consider:
+ 1. Similar titles or descriptions
+ 2. Same error messages or symptoms
+ 3. Related functionality or components
+ 4. Similar feature requests
+
+ If you find any potential duplicates, please comment on the new issue with:
+ - A brief explanation of why it might be a duplicate
+ - Links to the potentially duplicate issues
+ - A suggestion to check those issues first
+
+ Use this format for the comment:
+ '👋 This issue might be a duplicate of existing issues. Please check:
+ - #[issue_number]: [brief description of similarity]
+
+ If none of these address your specific case, please let us know how this issue differs.'
+
+ If no clear duplicates are found, do not comment."
diff --git a/.github/workflows/guidelines-check.yml b/.github/workflows/guidelines-check.yml
index e69de29bb..9f4915f58 100644
--- a/.github/workflows/guidelines-check.yml
+++ b/.github/workflows/guidelines-check.yml
@@ -0,0 +1,49 @@
+name: Guidelines Check
+
+on:
+ pull_request:
+ types: [opened, synchronize]
+
+jobs:
+ check-guidelines:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: write
+ id-token: write
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 1
+
+ - name: Install opencode
+ run: curl -fsSL https://opencode.ai/install | bash
+
+ - name: Check PR guidelines compliance
+ env:
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ opencode run --agent github -m anthropic/claude-sonnet-4-20250514 "A new pull request has been created: '${{ github.event.pull_request.title }}'
+
+ PR description:
+ ${{ github.event.pull_request.body }}
+
+ Please check all the code changes in this pull request against the guidelines in AGENTS.md file in this repository.
+
+ For each violation you find, create a file comment using the gh CLI. Use this exact format for each violation:
+
+ \`\`\`bash
+ gh pr review ${{ github.event.pull_request.number }} --comment-body 'This violates the AGENTS.md guideline: [specific rule]. Consider: [suggestion]' --file 'path/to/file.ts' --line [line_number]
+ \`\`\`
+
+ When possible, also submit code change suggestions using:
+
+ \`\`\`bash
+ gh pr review ${{ github.event.pull_request.number }} --comment-body 'Suggested fix for AGENTS.md guideline violation:' --file 'path/to/file.ts' --line [line_number] --body '```suggestion
+ [corrected code here]
+ ```'
+ \`\`\`
+
+ Only create comments for actual violations. If the code follows all guidelines, don't run any gh commands."