Skip to content

feat(cg-actions): source-aware version check (registry vs GitHub)#3

Open
tylerpaxton wants to merge 1 commit into
mainfrom
cg-actions-smart-version-check
Open

feat(cg-actions): source-aware version check (registry vs GitHub)#3
tylerpaxton wants to merge 1 commit into
mainfrom
cg-actions-smart-version-check

Conversation

@tylerpaxton

Copy link
Copy Markdown
Contributor

Summary

Makes cg-actions' update check aware of how the skill was installed, so it points users at the right update channel.

  • Installed via Chainguard Agent Skills (chainctl skills install ...): the files resolve under an .agents/skills/ directory (usually a symlink), so the check queries the registry — chainctl skills versions chainguard/chainguard-dev/cg-actions — and, if behind, suggests re-running the chainctl install.
  • Installed from GitHub (clone or downloaded .skill): compares against VERSION in this repo and suggests downloading the latest.

If the detected source is unreachable, it falls back to the other one. CG_ACTIONS_UPDATE_SOURCE=registry|github forces a choice. Version comparison is now semver-aware (1.10.1 > 1.2.0). Still non-blocking and silent on any network/auth failure.

Bumps VERSION to 1.3.0.

How detection works

chainctl skills install writes a canonical copy under .agents/skills/<name>/ and symlinks each agent's skills dir to it. The script resolves its own path; if it runs through .agents/skills/ (or the skill dir is a symlink), it treats the registry as the source of truth, otherwise GitHub.

Separate from #2 (README install wording); this is the checker logic only.

🤖 Generated with Claude Code

check_version.py now detects how the skill was installed and checks the matching
update channel:

- Installed via Chainguard Agent Skills (chainctl skills install): files resolve
  under an `.agents/skills/` dir (often a symlink), so it queries the registry
  with `chainctl skills versions chainguard/chainguard-dev/cg-actions` and, if
  behind, suggests re-running the chainctl install.
- Installed from GitHub (clone/download): compares against VERSION in
  chainguard-dev/cg-skills and suggests downloading the latest.

If the detected source is unreachable it falls back to the other, and
CG_ACTIONS_UPDATE_SOURCE=registry|github forces a choice. Version comparison is
now semver-aware (1.10.1 > 1.2.0). Non-blocking as before.

Bump VERSION to 1.3.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant