Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions .github/workflows/claude-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,33 @@ jobs:
if: github.event.label.name == 'claude-triage' || github.event.label.name == 'from-website'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
contents: read
steps:
- name: Generate Imagile Bot token
id: imagile-token
uses: actions/create-github-app-token@v3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify the action version — as of August 2025 actions/create-github-app-token was at v1. If v3 was released after that it's fine, but worth a quick double-check that it exists and the permission-* inputs you're using (lines 24–27) are supported in this version. The workflow will fail at the token-generation step if the version tag doesn't resolve.

with:
app-id: ${{ vars.IMAGILE_BOT_APP_ID }}
private-key: ${{ secrets.IMAGILE_BOT_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
permission-issues: write
permission-workflows: write

- name: Resolve Imagile Bot identity
id: imagile-bot
env:
GH_TOKEN: ${{ steps.imagile-token.outputs.token }}
run: |
BOT_LOGIN="${{ steps.imagile-token.outputs.app-slug }}[bot]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor security hardening${{ steps.imagile-token.outputs.app-slug }} is evaluated by the Actions runner and interpolated verbatim into the shell script before the shell sees it. GitHub App slugs are lowercase-alphanumeric-hyphen, so this is low-risk in practice — but binding through an env var is the defensive pattern that keeps the value as data rather than code:

Suggested change
BOT_LOGIN="${{ steps.imagile-token.outputs.app-slug }}[bot]"
env:
GH_TOKEN: ${{ steps.imagile-token.outputs.token }}
APP_SLUG: ${{ steps.imagile-token.outputs.app-slug }}
run: |
BOT_LOGIN="${APP_SLUG}[bot]"

echo "id=$(gh api "/users/${BOT_LOGIN}" --jq .id)" >> "$GITHUB_OUTPUT"
echo "login=${BOT_LOGIN}" >> "$GITHUB_OUTPUT"

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.imagile-token.outputs.token }}

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -35,6 +53,9 @@ jobs:
uses: anthropics/claude-code-action@v1.0.93
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ steps.imagile-token.outputs.token }}
bot_id: ${{ steps.imagile-bot.outputs.id }}
bot_name: ${{ steps.imagile-bot.outputs.login }}
track_progress: true
plugin_marketplaces: |
https://github.com/kolatts/claude-marketplace.git
Expand Down Expand Up @@ -169,7 +190,7 @@ jobs:
- name: Create PR if branch was pushed without one
if: success() || failure()
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ steps.imagile-token.outputs.token }}
run: |
BRANCH=$(git branch -r --list "origin/claude/issue-${{ github.event.issue.number }}*" | head -1 | tr -d ' ')
if [ -z "$BRANCH" ]; then
Expand Down Expand Up @@ -218,5 +239,5 @@ jobs:
- name: Remove triggering label
if: always() && github.event.label.name == 'claude-triage'
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ steps.imagile-token.outputs.token }}
run: gh issue edit ${{ github.event.issue.number }} --remove-label "claude-triage" --repo "${{ github.repository }}" || true
Loading