Skip to content
LatchkeyLatchkey home

gh release view: Inspect a Release in CI

gh release view displays a single release including its notes, tag, and attached assets.

Before downloading or promoting a release, gh release view confirms the tag, asset names, and draft state a job depends on.

What it does

gh release view shows one release by tag, or the latest release when no tag is given. Output includes the title, notes, publish date, and the list of attached asset names, which is handy for building a download --pattern.

Common usage

Terminal
gh release view
gh release view v1.2.0
gh release view v1.2.0 --json assets --jq '.assets[].name'
gh release view --web

Flags

FlagWhat it does
--json <fields>Output release data as JSON fields
-q, --jq <expression>Filter JSON output with jq
-t, --template <string>Format JSON with a Go template
-w, --webOpen the release in a browser
-R, --repo <owner/repo>Target a specific repository

In CI

Set GH_TOKEN and permissions: { contents: read }. Use --json assets to enumerate exact asset filenames before a gh release download, avoiding pattern misses. The latest-release default skips drafts and prereleases.

Common errors in CI

"release not found" means the tag does not exist or the token cannot see a draft. "gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable" means GH_TOKEN is missing. With no tag and no published release, view reports the repository has no releases.

Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached

Frequently asked questions

gh release view: Inspect a Release in CI?
Before downloading or promoting a release, gh release view confirms the tag, asset names, and draft state a job depends on.
What it does?
gh release view shows one release by tag, or the latest release when no tag is given. Output includes the title, notes, publish date, and the list of attached asset names, which is handy for building a download --pattern.
In CI?
Set GH_TOKEN and permissions: { contents: read }. Use --json assets to enumerate exact asset filenames before a gh release download, avoiding pattern misses. The latest-release default skips drafts and prereleases.
Common errors in CI?
"release not found" means the tag does not exist or the token cannot see a draft. "gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable" means GH_TOKEN is missing. With no tag and no published release, view reports the repository has no releases.

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card