rivet

GitHub Action

Create version pull requests and publish Rivet releases from GitHub Actions

Rivet provides a GitHub Action that automates the release workflow:

  1. Release files are merged into main.
  2. The Action runs rivet bump on a release branch and opens or updates a version pull request.
  3. After the version pull request is merged, the Action sees the release plan and runs the publish command.

This keeps version changes and changelogs reviewable before anything is published.

Setup

Create .github/workflows/release.yml:

name: Rivet Release

on:
  push:
    branches: [main]

permissions:
  contents: write
  pull-requests: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: pnpm

      - run: pnpm install --frozen-lockfile

      - uses: bdbch/rivet@v1
        with:
          publish: pnpm build && pnpm exec rivet release
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

The GITHUB_TOKEN must be allowed to write repository contents and pull requests. Add NPM_TOKEN as a repository secret with permission to publish the packages.

Native Builds

The Action does not guess how a repository builds its packages. The publish input is a shell command, so it can build native artifacts before calling rivet release:

with:
  publish: |
    pnpm build:native
    pnpm exec rivet release

The command only runs after a version pull request has been merged and a release plan exists.

Inputs

InputDefaultDescription
github-token${{ github.token }}Token for branches and pull requests
cwd.Working directory containing Rivet configuration
base-branchTriggering branchTarget branch for the version pull request
branchrivet-releaseVersion pull request branch
checkpnpm exec rivet check --jsonRelease state command
versionpnpm exec rivet bumpVersion and changelog command
publishnoneBuild and publish command
commit-messagechore: version packagesVersion branch commit message
pr-titlechore: version packagesVersion pull request title

Use check --json for custom check commands. Rivet returns pending_releases, ready_to_release, or nothing_to_release.

Action Versions

The Action is consumed directly from the Rivet repository; Marketplace publication is optional. The Release GitHub Action workflow creates immutable version tags and updates the major compatibility tag:

- uses: bdbch/rivet@v1

For stricter supply-chain pinning, replace v1 with the commit SHA from a specific action release.

Outputs

OutputDescription
publishedtrue when the publish command ran
has-releasetrue when release files or a plan were found
pull-request-numberCreated or updated version PR number

On this page