# gh release view: Inspect a Release in CI

> gh release view shows a release notes, assets, and metadata. Reference for the latest-release default, --json fields, and the not-found errors in CI.

Source: https://latchkey.dev/learn/command-reference/gh-release-view  
Updated: 2026-06-30

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

| Flag | What 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, --web | Open 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
```

> `git rev-parse --abbrev-ref HEAD` returns the literal string `HEAD` on a detached checkout rather than a branch name. On GitHub Actions read `github.ref_name` instead; the git command cannot know what it was checked out for.

## FAQ

### 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.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
