feat: auto-tag on version bump - #17
Conversation
When a PR that bumps the version in package.json merges to main, this workflow automatically creates and pushes the corresponding v* tag, which triggers the release workflow. Flow: bump version in PR -> merge -> auto-tag -> release builds Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA GitHub Actions workflow was added that detects version changes in Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Action
participant Repo as Repository (code)
participant Remote as Git Remote (origin)
Workflow->>Repo: checkout (fetch-depth:2)
Workflow->>Repo: read current `package.json` version
Workflow->>Repo: git show previous `package.json` version
Workflow->>Workflow: compare current vs previous -> changed?
alt changed = true
Workflow->>Remote: check if tag v<version> exists
alt exists
Remote-->>Workflow: tag exists -> exit 0
else not exists
Workflow->>Repo: create tag v<version>
Workflow->>Remote: push tag v<version>
Remote-->>Workflow: ack pushed
end
else changed = false
Workflow-->>Workflow: skip tagging
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/auto-tag.yml (1)
17-17: Pinactions/checkoutto a full commit SHA for supply-chain security.Using
@v4is functional, but GitHub's security guidance recommends pinning to a full-length commit SHA to prevent supply-chain attacks. The v4 tag currently points to11bd71901bbe5b1630ceea73d27597364c9af683. Change to- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683to lock to this immutable release.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/auto-tag.yml at line 17, Replace the floating tag "actions/checkout@v4" with the immutable commit SHA suggested in the comment so the workflow pins the action; locate the step that uses "actions/checkout@v4" and change it to use "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" to hard-pin the exact release for supply-chain security.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/auto-tag.yml:
- Around line 17-20: The workflow currently uses a shallow checkout
(actions/checkout@v4 with fetch-depth: 2) and later uses git rev-parse "$tag"
which only checks local refs and can miss remote tags; replace the local-only
check (git rev-parse "$tag") with a remote lookup using git ls-remote
--exit-code --tags origin "refs/tags/$tag" to verify if the tag already exists
on the remote before attempting to push, and keep the shallow checkout
configuration as-is.
---
Nitpick comments:
In @.github/workflows/auto-tag.yml:
- Line 17: Replace the floating tag "actions/checkout@v4" with the immutable
commit SHA suggested in the comment so the workflow pins the action; locate the
step that uses "actions/checkout@v4" and change it to use
"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" to hard-pin the
exact release for supply-chain security.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8d9c8fb0-c667-4bf8-9392-f4945f9e21cf
📒 Files selected for processing (1)
.github/workflows/auto-tag.yml
Shallow checkout (fetch-depth: 2) doesn't have local tag refs, so use git ls-remote to check if the tag exists on the remote. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
Adds a workflow that automatically creates a git tag when
package.jsonversion changes on main.Flow
package.jsonas part of a PRv{version}tagSafety
package.jsonis modified on main🤖 Generated with Claude Code
Summary by CodeRabbit