diff --git a/.github/workflows/claude-issue-investigate.yml b/.github/workflows/claude-issue-investigate.yml new file mode 100644 index 000000000..0189701cf --- /dev/null +++ b/.github/workflows/claude-issue-investigate.yml @@ -0,0 +1,75 @@ +name: Investigate issue + +# Gated on a maintainer-added label rather than issues: opened, since this is a public repo and anyone can open an issue - this way a human triages first before spending budget on a Claude session. +on: + issues: + types: [labeled] + +permissions: + contents: write + pull-requests: write + issues: read + id-token: write + +jobs: + investigate: + if: github.event.label.name == 'investigate' + runs-on: ubuntu-latest-large + env: + ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: Artifactory OIDC Auth + uses: ./.github/actions/artifactory-oidc + + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: 22 + + - run: corepack enable + + - name: Install dependencies + run: yarn install --immutable + + - name: Install Claude Code CLI + run: npm install -g @anthropic-ai/claude-code + + # New commits need an author - Claude never has repo write access outside this job. + - name: Configure git identity for Claude's commits + run: | + git config --global user.email "claude-bot@users.noreply.github.com" + git config --global user.name "claude-bot" + + # ISSUE_NUMBER only - title/body are untrusted, so Claude fetches them itself via gh rather than us splicing them into this script. + - name: Write prompt + env: + ISSUE_NUMBER: ${{ github.event.issue.number }} + run: | + cat > "$RUNNER_TEMP/claude-prompt.txt" <