Skip to content

Add workflow to tag plugin versions for dependency resolution - #497

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-eng:mainfrom
stbenjam:tags
May 26, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift-eng:mainfrom
stbenjam:tags

Conversation

@stbenjam

@stbenjam stbenjam commented May 24, 2026

Copy link
Copy Markdown
Member

Creates {plugin-name}--v{version} tags using claude plugin tag --push on each push to main that changes a plugin.json. Supports manual workflow_dispatch to backfill tags for all existing plugins.

See: https://code.claude.com/docs/en/plugin-dependencies#tag-plugin-releases-for-version-resolution

Summary by CodeRabbit

  • Chores
    • Added an automated workflow to create and push version tags for plugins when plugin configuration changes are pushed to main, with manual trigger support.
    • Skips tags that already exist, reports counts of created vs skipped, and only pushes tags when at least one was created; it does not track per-plugin failures or fail the run based on an errors counter.

@openshift-ci
openshift-ci Bot requested review from enxebre and stleerh May 24, 2026 11:27
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2026
@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a GitHub Actions workflow that triggers on pushes to main (when plugin.json files change) and manual dispatch, runs a job that checks out tags, scans plugin directories for .name and .version, creates git tags named {name}--v{version} when missing, and pushes newly created tags to origin; prints created/skipped totals.

Changes

Plugin Version Tagging Automation

Layer / File(s) Summary
Workflow triggers and concurrency
.github/workflows/tag-plugin-versions.yml
Adds workflow name, push trigger filtered on plugins/*/.claude-plugin/plugin.json, workflow_dispatch, and concurrency grouped by github.ref.
Job setup and checkout
.github/workflows/tag-plugin-versions.yml
Adds tag-plugins job gated to refs/heads/main, sets contents: write permission, uses ubuntu-latest, and checks out the repo with fetch-tags: true.
Tag creation loop and summary
.github/workflows/tag-plugin-versions.yml
Shell step iterates plugins/*/, validates plugin.json, extracts name/version with jq, builds {name}--v{version} tags, skips existing tags, creates missing tags with git tag, pushes tags to origin only if any were created, and prints created/skipped totals (no per-plugin error tracking).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

lgtm


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors)

Check name Status Explanation Resolution
No Assumed Git Remote Names ❌ Error Line 73 of .github/workflows/tag-plugin-versions.yml uses hardcoded git push origin --tags without discovering the remote name first. Discover remote name first via git remote -v or detect the upstream tracking branch, then use the discovered name in the push command.
Git Push Safety Rules ❌ Error Workflow executes automated git push origin --tags (line 73) without explicit user confirmation, violating "Flag any git push without user confirmation" and "Automated push workflows" rules. Remove the git push origin --tags command or require explicit user approval before pushing tags.
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and concisely summarizes the main change: adding a workflow to tag plugin versions, which is the sole focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Real People Names In Style References ✅ Passed PR adds only a GitHub Actions workflow for tagging plugin versions with no plugin commands, documentation, prompts, or style references with real people names.
No Untrusted Mcp Servers ✅ Passed PR adds a workflow file with git tagging logic only. Contains no MCP server installations, npm packages, or untrusted dependencies—only standard git and jq operations.
Ai-Helpers Overlap Detection ✅ Passed PR modifies workflow file (.github/workflows/tag-plugin-versions.yml), not ai-helpers files, so overlap detection doesn't apply.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tag-plugin-versions.yml:
- Around line 46-57: Add a workflow-level concurrency stanza to serialize runs
so the non-atomic sequence (the check `git tag -l "$tag"` followed by `claude
plugin tag --push`) cannot race; update the YAML to include a top-level
concurrency with a stable group (for example using the workflow name and ref
like `${{ github.workflow }}-${{ github.ref }}` or `${{ github.ref_name }}`) so
parallel runs that might touch the same `tag`/`plugin_path` are serialized and
avoid spurious increments of `errors` when tag creation races.
- Around line 19-25: Update the workflow to set actions/checkout (the step using
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd) to
persist-credentials: false so credentials are not left for later steps, and
replace the insecure one-liner run step (the `curl -fsSL
https://claude.ai/install.sh | bash` command) with Claude Code’s documented
pinned release integrity flow: pin a specific release tag, download the release
binary and its manifest.json plus manifest.json.sig, verify the manifest
signature with GPG, then verify the binary SHA-256 matches the manifest before
installation; implement these steps as separate run actions in the same job to
ensure signature and hash verification occur prior to executing the installer.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bdfb4372-ad0d-4509-9ec3-abe29ec80907

📥 Commits

Reviewing files that changed from the base of the PR and between def795e and 3ac48f5.

📒 Files selected for processing (1)
  • .github/workflows/tag-plugin-versions.yml

Comment thread .github/workflows/tag-plugin-versions.yml Outdated
Comment thread .github/workflows/tag-plugin-versions.yml Outdated
@stbenjam
stbenjam force-pushed the tags branch 2 times, most recently from 59cda08 to 7e3c3a1 Compare May 24, 2026 11:36

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tag-plugin-versions.yml:
- Line 17: Replace the non-immutable container reference
"ghcr.io/anthropics/claude-code:latest" used in the workflow's image: entry with
a pinned digest form (ghcr.io/anthropics/claude-code@sha256:<actual-digest>) to
make runs reproducible; obtain the digest by pulling the image locally (docker
pull ghcr.io/anthropics/claude-code:latest) and inspecting the repo digest
(e.g., docker inspect or docker image inspect / docker manifest inspect) then
update the image value to the returned `@sha256`:<digest>.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a7c5960e-f64c-488c-b419-d1d809e9ea13

📥 Commits

Reviewing files that changed from the base of the PR and between 3ac48f5 and 59cda08.

📒 Files selected for processing (1)
  • .github/workflows/tag-plugin-versions.yml

Comment thread .github/workflows/tag-plugin-versions.yml Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/tag-plugin-versions.yml (1)

21-21: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pin the container image to an immutable digest.

Line 21 uses :latest, which makes runs non-reproducible and weakens supply-chain traceability.

Suggested fix
-      image: ghcr.io/anthropics/claude-code:latest
+      image: ghcr.io/anthropics/claude-code@sha256:<resolved-digest>
#!/bin/bash
set -euo pipefail

# Resolve current digest for ghcr.io/anthropics/claude-code:latest (read-only)
token="$(python - <<'PY'
import json, urllib.request
url = "https://ghcr.io/token?service=ghcr.io&scope=repository:anthropics/claude-code:pull"
print(json.load(urllib.request.urlopen(url))["token"])
PY
)"

digest="$(curl -fsSI \
  -H "Authorization: Bearer ${token}" \
  -H "Accept: application/vnd.oci.image.manifest.v1+json" \
  "https://ghcr.io/v2/anthropics/claude-code/manifests/latest" \
  | awk -F': ' 'tolower($1)=="docker-content-digest"{gsub("\r","",$2); print $2}')"

echo "ghcr.io/anthropics/claude-code@${digest}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/tag-plugin-versions.yml at line 21, Replace the floating
tag image reference "ghcr.io/anthropics/claude-code:latest" in the workflow with
an immutable digest form "ghcr.io/anthropics/claude-code@<digest>" so runs are
reproducible and supply-chain traceable; obtain the current manifest digest for
the latest tag (e.g., via the provided token + manifest request or any OCI
registry query) and update the image line in
.github/workflows/tag-plugin-versions.yml to use that sha256 digest string
instead of :latest.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tag-plugin-versions.yml:
- Around line 11-12: Restrict the manual dispatch to only the main branch by
changing the workflow_dispatch declaration to include a branch filter (e.g.,
workflow_dispatch: { branches: [ "main" ] }) or by adding a top-level
conditional that prevents runs unless github.ref == 'refs/heads/main'; update
the existing workflow_dispatch entry so manual runs on feature branches are
blocked and only the main branch can trigger the release tagging.

---

Duplicate comments:
In @.github/workflows/tag-plugin-versions.yml:
- Line 21: Replace the floating tag image reference
"ghcr.io/anthropics/claude-code:latest" in the workflow with an immutable digest
form "ghcr.io/anthropics/claude-code@<digest>" so runs are reproducible and
supply-chain traceable; obtain the current manifest digest for the latest tag
(e.g., via the provided token + manifest request or any OCI registry query) and
update the image line in .github/workflows/tag-plugin-versions.yml to use that
sha256 digest string instead of :latest.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7b1cf2a3-9a3e-4a24-9a8e-143f55ae5d6f

📥 Commits

Reviewing files that changed from the base of the PR and between 59cda08 and 7e3c3a1.

📒 Files selected for processing (1)
  • .github/workflows/tag-plugin-versions.yml

Comment thread .github/workflows/tag-plugin-versions.yml
@stbenjam

Copy link
Copy Markdown
Member Author

The "Git Push Safety Rules" failure is a false positive — this workflow is specifically designed to push tags automatically on merge to main. The user permission is the merge itself; there is no interactive approval step to add here. The --push flag is integral to the purpose of the workflow.

@stbenjam
stbenjam force-pushed the tags branch 3 times, most recently from 4cfbd89 to ccb1473 Compare May 24, 2026 11:50
Creates {plugin-name}--v{version} tags using `claude plugin tag --push`
on each push to main that changes a plugin.json. Supports manual
workflow_dispatch to backfill tags for all existing plugins.

See: https://code.claude.com/docs/en/plugin-dependencies#tag-plugin-releases-for-version-resolution
continue
fi

git tag "$tag"

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.

I wonder if we might want to make this annotated tags so we preserve some metadata

@enxebre

enxebre commented May 26, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 26, 2026
@openshift-ci

openshift-ci Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre, stbenjam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 4f9ae69 into openshift-eng:main May 26, 2026
5 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 1, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants