with one click
release
// Guides Sourcegraph CLI patch, minor, and major releases. Use when preparing release branches, selecting patch commits, running Trivy checks, creating release tags, or managing local/pushed release artifacts.
// Guides Sourcegraph CLI patch, minor, and major releases. Use when preparing release branches, selecting patch commits, running Trivy checks, creating release tags, or managing local/pushed release artifacts.
| name | release |
| description | Guides Sourcegraph CLI patch, minor, and major releases. Use when preparing release branches, selecting patch commits, running Trivy checks, creating release tags, or managing local/pushed release artifacts. |
Gather only the information that is actually missing. Do not ask questions whose answers can be derived safely from tags, release branches, repository conventions, or the user's wording.
Before asking the user anything, derive the release plan:
release_type: from user wording or semver shape.version: from the explicit user version, otherwise from existing tags.release_branch: use the existing matching release branch when present; otherwise infer from recent branch convention. In this repository, use release/<major>.<minor>.x, for example release/7.2.x for 7.2.2.source: user-provided source, otherwise the repository default branch.tag: repository's existing release tag format. In this repository, use the bare version as a signed annotated tag with message Release v<version>, for example git tag -s 7.2.2 -m "Release v7.2.2".push_mode: local-only unless the user explicitly asks to push.worktree_mode: prefer temporary git worktrees when handling multiple release trains or when the current checkout is detached or managed by jj.Ask a narrow question only when a field cannot be inferred safely or the missing answer would change release artifacts or risk pushing/tagging the wrong thing:
For version inference:
git tag --list --sort=-v:refname.git branch -a --list '*release*'.Stop and ask before continuing if:
Never tag with a dirty working tree, unresolved conflicts, failed validation, or while checked out on the wrong branch.
Before starting the release work:
git status.git fetch --all --tags --prune.mise x trivy -- trivy fs --exit-code 1 --severity HIGH,CRITICAL.mise may require trusting that worktree's mise.toml. Run mise trust -y <worktree>/mise.toml when needed, then remove or untrust temporary state during cleanup.This repository is commonly used with jj, so git status may report HEAD (no branch). Treat that as normal if the worktree is otherwise clean.
Use the same workflow for patch, minor, and major releases. The release type mainly changes which commits from the source branch are included.
git cherry-pick -x <sha> for commits ported onto an existing release branch.Proceed?.Use this pre-tag summary format:
### Included in <release>
- <one-line summary> - PR #<number>
### Excluded
- <one-line summary> - PR #<number> (reason: <reason>)
Proceed?
For patch releases, infer the selection from the purpose of a patch release: include only low-risk fixes needed for the release line, and exclude features, broad refactors, cleanup-only work, and unrelated dependency churn unless the user explicitly asks otherwise.
For vulnerability-driven patch releases, include the full remediation closure, not just commits whose messages mention a CVE, scanner, or vulnerability. Toolchain, runtime, base-image, dependency-manifest, lockfile, scanner-configuration, and build/release-definition changes may be required prerequisites even when their commit messages are generic.
For minor and major releases, include the normal release-train contents from the source branch, respecting any user-requested exclusions or intentionally breaking-change boundaries.
When the user asks you to inspect history and decide what to port, compare the target release branch to the source branch and inspect likely candidates:
git log --oneline --reverse origin/release/7.2.x..origin/maingit show --stat --patch <candidate>git cherry -v origin/release/7.2.x <candidate> to notice already-applied equivalent changesDo not rely on commit messages alone. Inspect nearby commits, parent/child relationships, and file-level dependencies so prerequisite fixes are not missed. Before finalizing candidate selection, summarize any excluded adjacent prerequisite commits and why they are excluded.
git branch --show-current.When local release artifacts are ready, report:
git rev-list --left-right --count origin/release/7.2.x...release/7.2.x.