Skip to content

Add tool-version-upgrade skill for GitHub CLI and Bicep CLI#7458

Open
vhvb1989 wants to merge 2 commits intomainfrom
skill/tool-version-upgrade
Open

Add tool-version-upgrade skill for GitHub CLI and Bicep CLI#7458
vhvb1989 wants to merge 2 commits intomainfrom
skill/tool-version-upgrade

Conversation

@vhvb1989
Copy link
Copy Markdown
Member

@vhvb1989 vhvb1989 commented Apr 2, 2026

Summary

Adds a new Copilot skill (tool-version-upgrade) that automates upgrading bundled CLI tool versions (GitHub CLI and Bicep CLI) in azd.

Fixes #7457

Motivation

Every time GitHub CLI or Bicep CLI releases a new version, we manually check the latest release, create an issue, update version references in source code (and CI workflows for Bicep), and open a PR. This skill automates that entire workflow.

What the skill does

  1. Identifies the tool — asks which tool to upgrade (GitHub CLI or Bicep CLI)
  2. Fetches latest release — from cli/cli or Azure/bicep via gh CLI
  3. Compares versions — stops early if already up to date
  4. Confirms with user — mandatory confirmation gate (even in autopilot mode)
  5. Creates tracking issue — in Azure/azure-dev with file checklist
  6. Creates clean branch — from origin/main with dirty-state and staged-files verification
  7. Applies changes & opens PR — with build verification

Safety features

  • Mandatory confirmation gate — shows full summary (versions, files, actions) and requires explicit user approval even in autopilot/yolo mode
  • Clean branch enforcement — branches from origin/main, not the current branch; aborts on dirty working tree
  • Explicit file staging — stages only expected files (no git add -A); verifies nothing unexpected is staged
  • Already-up-to-date detection — stops early if versions match

Files updated per tool

Tool Files
GitHub CLI cli/azd/pkg/tools/github/github.go
Bicep CLI cli/azd/pkg/tools/bicep/bicep.go + .github/workflows/lint-bicep.yml

Files added

  • .github/skills/tool-version-upgrade/SKILL.md
  • .github/skills/tool-version-upgrade/references/tool-upgrade-workflow.md

Adds a Copilot skill that automates upgrading bundled CLI tool versions.
Supports GitHub CLI (cli/cli) and Bicep CLI (Azure/bicep) with safety
gates, mandatory user confirmation, clean branch creation from
origin/main, and staged-file verification.

Fixes #7457

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Copilot workflow skill (tool-version-upgrade) to automate upgrading the pinned/bundled versions of GitHub CLI and Bicep CLI in azd, including the associated issue/branch/PR workflow and safety gates.

Changes:

  • Added a new skill definition (SKILL.md) describing the end-to-end upgrade flow (detect tool, fetch latest release, confirm, create issue/branch/PR).
  • Added a shared reference document for the “clean branch from origin/main + stage-only-expected-files” workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/skills/tool-version-upgrade/SKILL.md Defines the tool upgrade skill, including per-tool files to update and the guarded workflow steps.
.github/skills/tool-version-upgrade/references/tool-upgrade-workflow.md Provides shared, reusable workflow guidance referenced by the skill.

Copy link
Copy Markdown
Member

@spboyer spboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vhvb1989 Looks good, great improvement. Address the copilot feedback and merge

Copy link
Copy Markdown
Member

@jongio jongio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issues to address:

  • SKILL.md:83 - version tag not validated as strict semver before injection into source/YAML
  • SKILL.md:154 - tracking issue created before build validation; failures leave orphan issues
  • SKILL.md:203 - git checkout -b fails if branch exists from a previous run

Minor: Step 4 doesn't handle current > latest (downgrade scenario).

The safety gates (mandatory confirmation, clean branch, explicit staging) are well designed.

- Validate version as strict semver after stripping v prefix; reject
  pre-release tags (jongio)
- Move issue creation after build succeeds to prevent orphan issues
  on build/staging failure (jongio)
- Delete stale branch from previous cancelled run before creating
  new branch (jongio)
- Handle current > latest case (downgrade detection) with warning
  and stop (jongio)
- Use two -m flags for git commit instead of literal newline
  (copilot-reviewer)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vhvb1989 vhvb1989 enabled auto-merge (squash) April 3, 2026 22:10
@vhvb1989
Copy link
Copy Markdown
Member Author

vhvb1989 commented Apr 3, 2026

/check-enforcer override

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.

Add tool-version-upgrade skill for GitHub CLI and Bicep CLI upgrades

4 participants