-
Notifications
You must be signed in to change notification settings - Fork 1
ci: dogfood git-mind suggest action with Claude CLI #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,64 @@ | ||||||||||||||
| name: git-mind Suggest | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| pull_request: | ||||||||||||||
| types: [opened, synchronize, reopened, ready_for_review] | ||||||||||||||
| branches: [main] | ||||||||||||||
|
|
||||||||||||||
| concurrency: | ||||||||||||||
| group: gitmind-suggest-${{ github.event.pull_request.number }} | ||||||||||||||
| cancel-in-progress: true | ||||||||||||||
|
|
||||||||||||||
| permissions: | ||||||||||||||
| contents: read | ||||||||||||||
| pull-requests: write | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| suggest: | ||||||||||||||
| if: > | ||||||||||||||
| !github.event.pull_request.draft && | ||||||||||||||
| github.actor != 'dependabot[bot]' | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| continue-on-error: true | ||||||||||||||
|
Comment on lines
+21
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because the whole job is marked Useful? React with 👍 / 👎. |
||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Check for API key | ||||||||||||||
| id: check-key | ||||||||||||||
| env: | ||||||||||||||
| HAS_KEY: ${{ secrets.ANTHROPIC_API_KEY != '' }} | ||||||||||||||
| run: | | ||||||||||||||
| if [ "$HAS_KEY" != "true" ]; then | ||||||||||||||
| echo "::notice::ANTHROPIC_API_KEY not configured — skipping suggest" | ||||||||||||||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||||||||||||||
| else | ||||||||||||||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| - name: Checkout | ||||||||||||||
| if: steps.check-key.outputs.skip != 'true' | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
| with: | ||||||||||||||
| fetch-depth: 0 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Node.js | ||||||||||||||
| if: steps.check-key.outputs.skip != 'true' | ||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||
| with: | ||||||||||||||
| node-version: '22' | ||||||||||||||
| cache: 'npm' | ||||||||||||||
|
|
||||||||||||||
| - name: Install dependencies | ||||||||||||||
| if: steps.check-key.outputs.skip != 'true' | ||||||||||||||
| run: npm ci | ||||||||||||||
|
|
||||||||||||||
| - name: Install Claude CLI | ||||||||||||||
| if: steps.check-key.outputs.skip != 'true' | ||||||||||||||
| run: npm install -g @anthropic-ai/claude-code | ||||||||||||||
|
Comment on lines
+54
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The latest published version of Source: npm package “Versions” tab shows Version 1.0.108 and “Last publish 5 hours ago.” [1] References Pin Line 56: Fix- run: npm install -g `@anthropic-ai/claude-code`
+ run: npm install -g `@anthropic-ai/claude-code`@1.0.108📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents🧩 Analysis chain🌐 Web query:
💡 Result: Anthropic’s official Claude Code (Claude CLI) docs state that “NPM installation is deprecated” and recommend using the native installation method instead; to migrate an existing npm install to native, run Recent Claude CLI release notes also mention an added deprecation notification for npm installations, pointing users to run Sources: 🌐 Web query:
💡 Result: The latest published version of the Source: npm package “Versions” tab. [1] 🌐 Web query:
💡 Result:
🌐 Web query:
💡 Result: Anthropic’s official Claude Code docs do not state that the CLI binary installs to Official install methods & where the
Citations:
"Installation via npm is deprecated. Use one of the recommended methods below." Anthropic's official documentation and release notes are explicit about this. The package itself now ships with a deprecation notification for npm installations. Beyond deprecation, the install is unpinned — every run silently picks up whatever the registry serves, with no auditability or rollback path if a breaking release lands. 🚑 Proposed fix — switch to the native installer at the current version - name: Install Claude CLI
if: steps.check-key.outputs.skip != 'true'
- run: npm install -g `@anthropic-ai/claude-code`
+ run: curl -fsSL https://claude.ai/install.sh | bash -s 1.0.108(The proposed fix in the original comment uses an incorrect version number 🤖 Prompt for AI Agents
Comment on lines
+54
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Installing Useful? React with 👍 / 👎. |
||||||||||||||
|
|
||||||||||||||
| - name: Run git-mind suggest | ||||||||||||||
| if: steps.check-key.outputs.skip != 'true' | ||||||||||||||
| uses: ./ | ||||||||||||||
| with: | ||||||||||||||
| agent: 'claude -p --output-format json' | ||||||||||||||
| env: | ||||||||||||||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||||||||||||||
|
Comment on lines
+60
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This step executes the local action from the PR checkout ( Useful? React with 👍 / 👎.
Comment on lines
+58
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For same-repository PRs, this job checks out the PR contents and then executes the local action from that checkout while exposing Useful? React with 👍 / 👎. |
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Bot guard only excludes
dependabot[bot]— other automation actors will consume API quota.renovate[bot],github-actions[bot], and custom bots are not excluded. Unless intentional, tighten the guard.🤖 Proposed fix
if: > !github.event.pull_request.draft && - github.actor != 'dependabot[bot]' + github.actor != 'dependabot[bot]' && + !endsWith(github.actor, '[bot]')📝 Committable suggestion
🤖 Prompt for AI Agents
🧹 Nitpick | 🔵 Trivial
Bot guard only excludes
dependabot[bot]— other automation actors will consume API credits.renovate[bot],github-actions[bot], and any custom bot actors are not excluded. Unless intentional, add a broader guard.🤖 Proposed fix
if: > !github.event.pull_request.draft && - github.actor != 'dependabot[bot]' + github.actor != 'dependabot[bot]' && + github.actor != 'renovate[bot]' && + !endsWith(github.actor, '[bot]')🤖 Prompt for AI Agents