# Add an SBOM to a Go CLI's GoReleaser Release

Yes. An agent adds a syft SBOM per archive to your GoReleaser config and release workflow, proves it with a snapshot release in its sandbox, and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/add-sbom-to-release/go-cli/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent clones the repository into its own cloud sandbox and reads how releases are built before adding to them. In a CLI like junegunn/fzf, `.goreleaser.yml` is `version: 2` with one build id `fzf` across `darwin`, `linux`, `windows`, `freebsd`, `openbsd` and `android` and seven architectures with an `ignore` list, `-trimpath` and `ldflags` that stamp `main.version` and `main.revision`, a `notarize.macos` block whose `enabled` is `{{ not .IsSnapshot }}` and whose certificate and key come from `MACOS_SIGN_P12`, `MACOS_NOTARY_ISSUER_ID` and three more environment variables, `archives` as `tar.gz` with `zip` for Windows, an `nfpms` entry producing a `deb` that installs `man/man1/fzf.1`, and `release.prerelease: auto`. There is no `sboms` section, no `checksum` customization and no `signs` block.

`.github/workflows/release.yml` runs on a `v*` tag on `macos-latest` behind a `release` environment gate, verifies the version appears in `CHANGELOG.md`, both man pages, `install` and `install.ps1`, extracts the release notes, and runs `goreleaser/goreleaser-action@v7` with `release --clean --release-notes tmp/release-note`, or `--snapshot --skip=publish` on a manual dispatch, with the notarization secrets in `env`. `RELEASE.md` documents that flow step by step, and `install` downloads the archive for the user's platform from the GitHub release without checking a checksum. The agent adds a `sboms` section to `.goreleaser.yml` with `artifacts: archive`, which runs `syft` on every archive and attaches a `.sbom.json` per archive to the release, and a step in `release.yml` before GoReleaser that installs `syft` with `anchore/sbom-action/download-syft`, since the GoReleaser action does not bring it.

The agent then proves the configuration in the sandbox rather than on the next tag. It installs `goreleaser` and `syft`, runs `goreleaser check` on the changed file, and runs `goreleaser release --snapshot --clean --skip=publish`, the same command the workflow's manual dispatch uses; because the notarize block is enabled only outside snapshots, that run needs no Apple credentials. It lists `dist/` afterwards: the archives, the `deb`, the `checksums.txt` that GoReleaser writes by default, and one SBOM beside each archive. It opens one SBOM to show the `github.com/junegunn/fzf` module and the direct dependencies from `go.mod`, `github.com/gdamore/tcell/v2`, `github.com/charlievieth/fastwalk`, `github.com/rivo/uniseg` and the rest, with their versions.

Two things stay as they are and the pull request says why. The `nfpms` `deb` is not an archive, so it gets no SBOM from this section; adding `artifacts: package` is one more line and is offered as an option. And the `install` script is left alone, because the SBOM describes what is in an archive and does not verify it; signing the checksums with `cosign` is the change that would let `install` verify, and it is a separate pull request. `RELEASE.md` gets a sentence under the workflow description saying the release now carries an SBOM per archive and where to find it.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Add an SBOM to this Go CLI's GoReleaser release. Read .goreleaser.yml, the release workflow under .github/workflows and the release documentation first. Add a sboms section that produces a syft SBOM for every archive, and install syft in the release workflow before GoReleaser runs. In your sandbox, install goreleaser and syft, run goreleaser check, then run a snapshot release with publishing skipped, list the dist directory and put the file list and the head of one SBOM in the pull request. Change no build, archive or packaging setting. Add one sentence to the release documentation. Open a pull request.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request on its own branch that changes `.goreleaser.yml`, `.github/workflows/release.yml` and `RELEASE.md`, and nothing in `src/`, `shell/` or `man/`. The description has the `goreleaser check` result, the snapshot run's summary, the `dist/` listing with one `.sbom.json` next to each archive, and the first entries of one SBOM showing the module and its dependencies with versions.

The run's record keeps the tool installation, the check, the full snapshot release output and the listing, so a reviewer can see the configuration was exercised on this repository's build matrix and not only read.

Before merging, a reviewer confirms that the SBOM step does not change the asset names the `install` and `install.ps1` scripts and the `winget.yml` publish step match on, decides whether the `deb` should get an SBOM too, and runs the workflow once by hand with a snapshot, as `RELEASE.md` already describes for testing, to see the new step on a real runner.

## Run it on every repository

Start this once from a terminal with `POST /o/{org}/sessions`, this body and the repository in `resources`. The run keeps going in its sandbox after you close the window, and a follow-up through `POST /o/{org}/sessions/{id}/messages` can add `cosign` signing of the checksums, or an SBOM for the `deb`, in the same sandbox without a second snapshot build from cold. After the merge, every tag push produces the SBOMs on its own.

An organization with several Go CLIs starts one run per repository from a script with the same body, each with its own `request_id`, a UUID, so a retried start returns the run it already began; the key's `webhook_url` receives `run.completed` for each with a `session_url` from which the handler reads the pull request link.

## Why run it on Rush?

The only way to know a GoReleaser change works is to run a release, and nobody wants to find out on a tag that the SBOM step failed behind a notarization gate. The agent runs the snapshot release in its own sandbox with the exact command the workflow uses, and the pull request carries the file listing and an SBOM excerpt from that run.

The sandbox is disposable: a cross-build for six operating systems leaves nothing on anyone's machine, and the full output of the snapshot stays with the run. Several CLIs can be done at once, each with its own pull request and its own listing.

## Frequently asked questions

### Does the SBOM cover the deb package too?

Not with `artifacts: archive` alone, which is what the pull request adds. GoReleaser can also produce one per package with `artifacts: package`, and the pull request names that as a one-line follow-up for a reviewer who wants it.

### Why install syft in the workflow?

GoReleaser calls `syft` as an external command and the GoReleaser action does not install it. The `anchore/sbom-action/download-syft` step puts it on the runner before the release step, and the sandbox run shows the same pairing working.

### Does this verify downloads or sign anything?

No. An SBOM says what is inside an archive. Verifying that an archive is the one the release built needs the checksums signed, which is a `signs` block with `cosign` and a change to the `install` scripts, and is a separate pull request the agent can do on request.

### Will the macOS notarization still run?

Yes, unchanged. The notarize block is enabled only outside snapshots, which is why the sandbox snapshot needed no Apple credentials, and the real tag run keeps the same secrets in `env` as before.

## More Go CLI jobs

- [Add Shell Completion to a Go CLI from a Linear Issue](https://getrush.ai/run/add-shell-completion/go-cli/)
- [Add Snapshot Tests to a Go CLI's Rendered Output](https://getrush.ai/run/add-snapshot-tests/go-cli/)
- [Fix golangci-lint Findings in a Go CLI and Make Lint Block Merges](https://getrush.ai/run/fix-lint-warnings/go-cli/)

## The same job on other stacks

- [Add an SBOM to the Release of a Cobra CLI](https://getrush.ai/run/add-sbom-to-release/cobra/)

## More jobs like this: Hand off a long task

- [Add a Scheduled Job to a Medusa Backend](https://getrush.ai/run/add-scheduled-job/medusa/)
- [Add a Scheduled Job to a Flask App with RQ](https://getrush.ai/run/add-scheduled-job/rq/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
