refactor: skip gh CLI upgrade when already at minimum version for skill support#42639
Merged
Conversation
…w 2.90 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…larify comment Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
refactor: only upgrade gh CLI when below minimum version for skill support
refactor: skip gh CLI upgrade when already at minimum version for skill support
Jul 1, 2026
Copilot created this pull request from a session on behalf of
pelikhan
July 1, 2026 04:55
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes activation-job generation for frontmatter skill installation by avoiding an unconditional GitHub CLI (gh) upgrade on every run, and instead only upgrading when the installed gh is below the minimum required for skill support.
Changes:
- Added a single source of truth (
constants.GhSkillsMinVersion) for the minimumghversion required for frontmatter skill support. - Updated the activation job’s “Upgrade gh CLI for frontmatter skills” step to version-check first and only run the installer when the runner’s
ghis older than the required minimum.
Show a summary per file
| File | Description |
|---|---|
| pkg/constants/version_constants.go | Adds GhSkillsMinVersion constant for minimum gh skill-support version. |
| pkg/workflow/compiler_activation_job_builder.go | Updates generated bash step to conditionally run the gh upgrade based on current version. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Low
Comment on lines
546
to
548
| ctx.steps = append(ctx.steps, fmt.Sprintf(" REQUIRED=\"%s\"\n", constants.GhSkillsMinVersion)) | ||
| ctx.steps = append(ctx.steps, " GH_VERSION=$(gh --version | awk 'NR==1 {print $3}')\n") | ||
| ctx.steps = append(ctx.steps, " REQUIRED=\"2.90.0\"\n") | ||
| ctx.steps = append(ctx.steps, " echo \"gh version: ${GH_VERSION}\"\n") |
pelikhan
reviewed
Jul 1, 2026
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
….sh and add tests Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The skill installation step unconditionally ran
install_gh_cli.sh(fullapt-getupgrade) on every workflow run, even when the runner'sghwas already new enough. This is wasteful and slow.Changes
pkg/constants/version_constants.go— addedGhSkillsMinVersion = "2.90.0", the minimumghversion required forgh extension install(frontmatter skill support).pkg/workflow/compiler_activation_job_builder.go— the generated bash step now checks the current version first and only invokesinstall_gh_cli.shwhen below the minimum. TheREQUIREDvariable and error message both derive fromGhSkillsMinVersion; no hardcoded version strings remain.Before (always upgrades):
After (upgrades only when needed):