From 69c60679397dcf12c3fb66e79ef65e007c9dcf7f Mon Sep 17 00:00:00 2001 From: DJ Date: Sun, 5 Apr 2026 14:23:24 -0700 Subject: [PATCH] chore: enable Claude issue trigger per org CI standard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add issues:[labeled] event trigger and claude label support so Claude can work issues autonomously — reading the issue, creating a branch, implementing the fix, and opening a PR. Changes: - Add issues:[labeled] trigger to on: block - Add issue label condition to job if: guard - Upgrade contents permission to write (needed for branch creation) - Pin claude-code-action to v1.0.89 (6e2bd528) - Add label_trigger: "claude" input - Add dependabot skip condition on step - Add permission comment for contents: write Matches the standard defined in petry-projects/.github#24. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/claude.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 0758f96..6ad0436 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -1,7 +1,5 @@ name: Claude Code -permissions: {} - on: pull_request: branches: [main] @@ -10,6 +8,10 @@ on: types: [created] pull_request_review_comment: types: [created] + issues: + types: [labeled] + +permissions: {} jobs: claude: @@ -21,16 +23,21 @@ jobs: contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && - contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) + contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || + (github.event_name == 'issues' && github.event.action == 'labeled' && + github.event.label.name == 'claude') runs-on: ubuntu-latest timeout-minutes: 60 permissions: - contents: read + # write required for issue-triggered branch creation + contents: write id-token: write pull-requests: write issues: write steps: - name: Run Claude Code - uses: anthropics/claude-code-action@e7b588b6eaa5263c2e7c6c7b34a29e190d32ee68 # v1 + if: github.event_name != 'pull_request' || github.event.pull_request.user.login != 'dependabot[bot]' + uses: anthropics/claude-code-action@6e2bd52842c65e914eba5c8badd17560bd26b5de # v1.0.89 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + label_trigger: "claude"