From 5882055c28b9a728bf8465d82c1ddbbdd11152fc Mon Sep 17 00:00:00 2001 From: "bonk[bot]" Date: Fri, 26 Dec 2025 11:23:50 -0500 Subject: [PATCH 1/3] Update Bonk workflow to use elithrar/ask-bonk/github@main --- .github/workflows/bonk.yml | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index a86212a..c509ab5 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -5,50 +5,27 @@ on: types: [created] pull_request_review_comment: types: [created] - pull_request_review: - types: [submitted] jobs: bonk: - if: | - github.event.sender.type != 'Bot' && - ( - (github.event_name == 'issue_comment' && (contains(github.event.comment.body, '@ask-bonk') || contains(github.event.comment.body, '/bonk'))) || - (github.event_name == 'pull_request_review_comment' && (contains(github.event.comment.body, '@ask-bonk') || contains(github.event.comment.body, '/bonk'))) || - (github.event_name == 'pull_request_review' && (contains(github.event.review.body, '@ask-bonk') || contains(github.event.review.body, '/bonk'))) - ) + if: github.event.sender.type != 'Bot' runs-on: ubuntu-latest permissions: id-token: write contents: write issues: write pull-requests: write + checks: write steps: - - name: Check user permission - uses: actions/github-script@v7 - with: - script: | - const { data: permissionLevel } = await github.rest.repos.getCollaboratorPermissionLevel({ - owner: context.repo.owner, - repo: context.repo.repo, - username: context.actor - }); - const permission = permissionLevel.permission; - if (permission !== 'admin' && permission !== 'write') { - core.setFailed(`User ${context.actor} does not have write permission (has: ${permission})`); - } - - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 - + - name: Run Bonk - uses: sst/opencode/github@dev + uses: elithrar/ask-bonk/github@main env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} with: model: opencode/claude-opus-4-5 - share: false - oidc_base_url: "https://ask-bonk.silverlock.workers.dev/auth" mentions: "/bonk,@ask-bonk" From 0d6b5869c63d8c0d217b616efcfbbebae3041d5b Mon Sep 17 00:00:00 2001 From: "bonk[bot]" Date: Fri, 26 Dec 2025 11:31:50 -0500 Subject: [PATCH 2/3] Use permissions: write-all for simpler config --- .github/workflows/bonk.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index c509ab5..40ca017 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -10,12 +10,7 @@ jobs: bonk: if: github.event.sender.type != 'Bot' runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - issues: write - pull-requests: write - checks: write + permissions: write-all steps: - name: Checkout repository uses: actions/checkout@v4 From 0d18e4f20663d694c66dbf4726d6589bc6707b33 Mon Sep 17 00:00:00 2001 From: "bonk[bot]" Date: Fri, 26 Dec 2025 11:46:53 -0500 Subject: [PATCH 3/3] Fix permissions: revert write-all, add permissions: write input --- .github/workflows/bonk.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index 40ca017..65f11a6 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -10,7 +10,11 @@ jobs: bonk: if: github.event.sender.type != 'Bot' runs-on: ubuntu-latest - permissions: write-all + permissions: + id-token: write + contents: write + issues: write + pull-requests: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -24,3 +28,4 @@ jobs: with: model: opencode/claude-opus-4-5 mentions: "/bonk,@ask-bonk" + permissions: write