Tegami

GitHub

Version Packages pull requests and GitHub releases.

The GitHub plugin automates the Changesets-style release flow: open a Version Packages PR after versioning, then create GitHub releases after publish. It includes the git plugin for tag creation.

import { github } from "tegami/plugins/github";

const paper = tegami({
  plugins: [
    github({
      repo: "your-org/your-repo",
    }),
  ],
});

Configuration

Prop

Type

Requirements

  • GITHUB_TOKEN with permission to create pull requests and releases.

In GitHub Actions, your workflow needs at least:

permissions:
  contents: write
  id-token: write
  pull-requests: write

See CI Setup for a complete workflow example.

Version Packages PR

After tegami version applies a plan in CI, the plugin:

  1. Creates or updates the tegami/version-packages branch.
  2. Commits version and changelog changes.
  3. Opens a pull request against your base branch.

Configure the PR behavior:

github({
  repo: "your-org/your-repo",
  versionPr: {
    branch: "tegami/version-packages",
    base: "main",
    groups: ["group:fumadocs", ["@fumadocs/local-md", "fumadocs-mdx"]],
  },
});

Set versionPr: false to disable PR creation. Set versionPr: { forceCreate: true } to always create the PR, including locally.

Publish groups

Create one PR per groups entry, unlisted packages get an unlisted PR. Accepts package groups, package names and IDs.

github({
  versionPr: {
    branch: "tegami/version-packages",
    groups: ["group:fumadocs", ["@fumadocs/local-md", "fumadocs-mdx"]],
  },
});

Branches are <branch>/<group-id>:

tegami/version-packages/group-fumadocs
tegami/version-packages/fumadocs-local-md-fumadocs-mdx
tegami/version-packages/unlisted

Avoid branch conflicts

Delete the flat tegami/version-packages branch on origin before enabling groups.

CLI commands

runCli wraps the programmatic API. Pass the same tegami() instance you use in scripts.

CommandDescription
tegami pr previewBuild a pull request release preview
tegami pr commentPost a pull request preview artifact

GitHub releases

After a successful publish, the plugin creates a GitHub release for each git tag. Release notes come from the changelog sections attached to each package.

For grouped tags (syncGitTag), one release covers all packages in the group.

Set release: false to disable GitHub release creation.

github({
  repo: "your-org/your-repo",
  release: {
    // create a release as soon as a tag succeeds, without waiting for the whole plan
    eager: false,
    create({ tag, pkg, plan }) {
      return {
        title: tag,
        notes: `Released ${pkg.name}`,
        prerelease: false,
      };
    },
    createGrouped({ tag, packages, plan }) {
      return {
        title: tag,
        notes: packages.map((pkg) => pkg.name).join("\n"),
      };
    },
  },
});

On this page