From cc623c36021011b50008ca857a6af45779d04f11 Mon Sep 17 00:00:00 2001 From: 404-Page-Found <139850808+404-Page-Found@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:19:33 +1000 Subject: [PATCH] Add GitHub Actions workflow for issue labeling --- .github/workflows/issue-label.yml | 80 +++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/issue-label.yml diff --git a/.github/workflows/issue-label.yml b/.github/workflows/issue-label.yml new file mode 100644 index 0000000..03fd114 --- /dev/null +++ b/.github/workflows/issue-label.yml @@ -0,0 +1,80 @@ +name: issue-label + +on: + issues: + types: [opened] + workflow_dispatch: + inputs: + issue_number: + description: 'Issue number to (re)label' + required: true + type: number + +concurrency: + group: issue-label-${{ github.event.issue.number || inputs.issue_number }} + cancel-in-progress: true + +jobs: + label: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + issues: write + + steps: + - name: Install OpenCode + run: npm install -g opencode-ai + + - name: Fetch existing labels + id: labels + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + { + echo 'list<> "$GITHUB_OUTPUT" + + - name: Label issue with OpenCode + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + ISSUE_NUMBER: ${{ github.event.issue.number || inputs.issue_number }} + LABELS: ${{ steps.labels.outputs.list }} + # The model can only read this issue and add labels. No comments, no file edits, no web. + OPENCODE_PERMISSION: >- + { + "edit": "deny", + "webfetch": "deny", + "bash": { + "*": "deny", + "gh issue view *": "allow", + "gh issue edit *": "allow" + } + } + run: | + opencode run --model opencode/mimo-v2.6-flash-free "$(cat <