# Add govulncheck to CI for a Fiber Multi-Module Repository

Yes. An agent adds a govulncheck workflow that scans changed Go modules on pull requests and every module on a schedule, reports what it finds today, and opens a PR.

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

## What the agent does

The agent reads how the repository builds before it adds a check. In a cookbook laid out like gofiber/recipes, 91 `go.mod` files define independent modules, 82 at the top level and the rest nested one level down in folders such as `rabbitmq/worker` and `envoy-extauthz/app`; nearly all require `github.com/gofiber/fiber/v3` at 3.6.1 on `go 1.26.0`, one still on v2. The root `go.mod` names a module with no code of its own. `Makefile` has an `audit` target that runs `go mod verify`, `go vet` and `govulncheck@latest` from the root, where there is nothing to scan, and nobody runs it in CI.

CI is in `.github/workflows/`: `build.yml` runs `go vet` and `go build -race` on Go 1.26 and 1.27 over a `blacksmith-8vcpu-ubuntu-2404` runner, walking up from each changed file to the module that owns it on pull requests and taking every module on `master`, fanned out with `xargs -P`; `lint.yml` calls a reusable golangci-lint workflow pinned to v2.14.0; `workflow-lint.yml` runs actionlint with a config that knows the `blacksmith-*` labels; `codeql.yml` runs weekly and on pull requests; and `dependabot_automerge.yml` merges Dependabot's module bumps once checks matching `builds|^lint /` pass. Actions are pinned to commit SHAs with version comments, and `dependabot.yml` splits the `gomod` ecosystem into directory globs with groups per Fiber module family.

The agent writes `.github/workflows/govulncheck.yml` in the same shape. It triggers on pushes to `master`, on pull requests, on a weekly `schedule`, and on `workflow_dispatch`, with the same `concurrency` group and `contents: read`. One job sets up Go 1.27 with the pinned `actions/setup-go` and caching keyed on every `go.sum`, installs `golang.org/x/vuln/cmd/govulncheck` once at a pinned release rather than `@latest`, and reuses the directory walk from `build.yml`: changed modules on a pull request, every `go.mod` otherwise. It runs `govulncheck ./...` inside each module in parallel with the output prefixed by directory, so a finding names its module, and exits non-zero when any module reports a reachable vulnerability. The `Makefile`'s `audit` target is pointed at the same per-module loop so a maintainer can run it locally.

Before opening the pull request the agent installs the Go toolchain the modules ask for, runs the loop over all 91 modules in its sandbox, and reads the result. `govulncheck` reports only vulnerabilities whose affected functions the module actually calls, so most entries in a cookbook of small examples are expected to be clean; any module that is not gets a line in the description with the Go vulnerability id, the package, and the version that fixes it, and a Dependabot bump is the usual fix since `dependabot.yml` already covers every module. The agent runs `actionlint` with the repository's config over the new workflow, and notes that `dependabot_automerge.yml` only waits for checks matching `builds|^lint /`, so the new check is advisory for bot pull requests until the pattern is widened.

## Start it with one API call

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

```json
{
  "agent": "claude",
  "input": "Add govulncheck to CI for this Fiber repository. Read every go.mod, the Makefile, and build.yml, lint.yml, workflow-lint.yml, dependabot.yml and dependabot_automerge.yml under .github/workflows and .github first. Write .github/workflows/govulncheck.yml in the shape of build.yml: triggers on push to master, pull_request, a weekly schedule and workflow_dispatch, the same concurrency group, contents: read, pinned actions with version comments, Go set up from the newest version in the build matrix with a cache keyed on every go.sum, govulncheck installed once at a pinned release, and the same walk from changed files to their module on pull requests and every go.mod otherwise. Run govulncheck ./... per module in parallel with output prefixed by directory and fail if any module reports a reachable vulnerability. Point the Makefile audit target at the same per-module loop. Run the loop over every module in the sandbox and actionlint over the workflow, then open a pull request that lists any module with a finding, its vulnerability id and fixed version, and notes whether the automerge pattern needs the new check.",
  "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

The pull request adds `.github/workflows/govulncheck.yml` and changes the `audit` target in `Makefile`. Its description lists the modules the sandbox run scanned, any module with a finding together with the vulnerability id, the package and the fixed version, the `actionlint` result, and a note on `dependabot_automerge.yml`'s check pattern.

From then on, a pull request that touches a module gets that module scanned, with the output grouped by directory in the job log, and the weekly run scans all 91 so a vulnerability published against a dependency nobody touched still surfaces within the week. A finding is usually resolved by the Dependabot pull request that bumps the module, which the new check then confirms.

Before merging, a reviewer decides whether the check should block the Dependabot automerge, which means adding its name to the `match_pattern`, whether the weekly run should also open an issue when it fails, and whether the one module still on Fiber v2 should move to v3 first, since fixes land on the current major.

## Run it on every week

A team with several Go repositories sends this body once per repository from its own server, each a `POST /o/{org}/sessions` with that repository in `resources` and a `request_id` that is a UUID v5 of the repository's full name, so a retried call returns the run already started. Each run reads its own layout: a repository with one `go.mod` gets a single `govulncheck ./...` step, and one with a workspace file gets the loop driven by `go work`.

Once the workflow runs, an automation on the Project with a `github` trigger on `workflow_run.failure` and the prompt "if the govulncheck workflow failed, read its log, find the module and the fixed version, run go get for that version in that module, run go build and go vet there, and open a pull request" starts one run per failure. The trigger adds the event after the prompt, and the run pushes a branch only when a fixed version exists; a vulnerability with no fix yet gets a comment instead.

## Why run it on Rush?

The hard part of vulnerability scanning in a repository of 91 modules is not the tool but the plumbing: which modules changed, how to run the scan in parallel without losing which module a line belongs to, and how to fit a new check beside an automerge rule that only knows the old ones. The agent reads the existing build workflow, reuses its module walk instead of inventing another, and runs the whole loop once in a sandbox so the first result is in the pull request rather than in a failed CI run.

The scan output for every module and the actionlint result stay with the run, so a reviewer can see what a clean week looks like before the schedule produces one. A team with many Go repositories runs the same request across all of them at once, each in its own sandbox, and gets a workflow per repository fitted to that repository's module layout.

## Frequently asked questions

### Why not run govulncheck once from the repository root?

The root `go.mod` names a module with no code, so a scan there sees nothing, which is why the existing `audit` target reports clean today. Each example is its own module with its own `go.sum`, and the scan has to run inside each one to see what it imports.

### Does govulncheck fail on every known vulnerability in a dependency?

No. It reports vulnerabilities whose affected functions are reachable from the module's code, and lists the rest as informational, so a dependency that is pinned to a vulnerable version but never calls the broken function does not fail the job. That keeps a cookbook of small examples from failing on every advisory in the Go database.

### Why pin govulncheck to a release instead of @latest like the Makefile did?

An unpinned tool can change its output or flags between two runs of the same workflow, and a pinned release moves only when someone bumps it. The job installs one release once and the `Makefile` target uses the same version, so local and CI results agree.

### Will it block Dependabot's automerge?

Not until the `match_pattern` in `dependabot_automerge.yml` includes the new check's name, which the pull request points out rather than changes. Widening the pattern is a one-line edit once the maintainers have watched the check run for a while.

## More Fiber jobs

- [Add Graceful Shutdown to a Fiber App](https://getrush.ai/run/add-graceful-shutdown/fiber/)
- [Add Health Checks to a Fiber API](https://getrush.ai/run/add-health-checks/fiber/)
- [Add Idempotency Keys to a Fiber API](https://getrush.ai/run/add-idempotency-middleware/fiber/)

## The same job on other stacks

- [Add govulncheck to a Go CLI's CI](https://getrush.ai/run/add-govulncheck-to-ci/go-cli/)
- [Add govulncheck to a Cobra CLI's CI](https://getrush.ai/run/add-govulncheck-to-ci/cobra/)

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

- [Add Graceful Shutdown to an Actix Web App](https://getrush.ai/run/add-graceful-shutdown/actix/)

## 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/)
