Skip to content
Shipcheck

Reference

CI

Shipcheck runs the same way in CI as on your laptop. A failed check exits with code 1, which fails the job.

GitHub Actions

Install Shipcheck with Go, set up whatever your tests and build need, and run it. Pass required environment variables from repository secrets. Shipcheck checks that they're set, never what they contain.

.github/workflows/shipcheck.yml
name: Shipcheckon:  push:    branches: [main]  pull_request:jobs:  shipcheck:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4        with:          fetch-depth: 0   # full history and tags for the version check      - uses: actions/setup-go@v5        with:          go-version: stable      # Set up your own toolchain too, e.g. actions/setup-node + npm ci.      - name: Install Shipcheck        run: go install github.com/App-Chef/shipcheck/cli/cmd/shipcheck@latest      - name: Run Shipcheck        run: shipcheck --verbose        env:          DATABASE_URL: ${{ secrets.DATABASE_URL }}

GitLab CI

.gitlab-ci.yml
shipcheck:  image: golang:1.24  variables:    GIT_DEPTH: 0  script:    - go install github.com/App-Chef/shipcheck/cli/cmd/shipcheck@latest    - shipcheck --verbose

Any other CI

Shipcheck only needs the binary and your toolchain. The pattern is always the same:

bash
$ go install github.com/App-Chef/shipcheck/cli/cmd/shipcheck@latest$ shipcheck --verbose

--verbose is useful in CI logs: it shows which commands ran, how long they took, and the tail of any failing output.

Keep a JSON report

--json prints a machine-readable report and keeps the same exit codes. Save it as a build artifact, or parse it to post a summary. See JSON output for the format.

GitHub Actions steps
      - name: Run Shipcheck        run: shipcheck --json > shipcheck.json      - name: Upload report        if: always()        uses: actions/upload-artifact@v4        with:          name: shipcheck-report          path: shipcheck.json

Gate a deploy

Because the exit code is 0 only when nothing failed, Shipcheck composes with any deploy command:

bash
$ shipcheck && ./deploy.sh$ shipcheck --json | jq -e '.ready' && npm run deploy

Differences in CI

  • Branch. CI systems often check out a detached HEAD, so the branch check is skipped rather than failed.
  • Working tree. Steps that write files (such as a build output that isn't in .gitignore) make the tree dirty. Ignore those paths, or set git_clean: warn.
  • Environment. There is usually no .env file in CI. Provide required variables through your CI's secret settings.

Shipcheck's own repository runs itself in CI. See ci.yml.

Found a mistake? Edit this page on GitHub