GitHub
@simple-release/github implements the hosting interface for GitHub: the release step creates GitHub releases, and the pullRequest step creates release pull requests.
pnpm add @simple-release/githubnpm i @simple-release/githubyarn add @simple-release/githubimport { Releaser } from '@simple-release/core'import { PnpmProject } from '@simple-release/pnpm'import { GithubHosting } from '@simple-release/github'
await new Releaser({ project: new PnpmProject(), hosting: new GithubHosting({ token: process.env.GITHUB_TOKEN })}) .bump() .commit() .tag() .push() .publish() .release() .run()In the config file use the JS variant, so the token can be taken from an environment variable:
import { GithubHosting } from '@simple-release/github'
export const hosting = new GithubHosting({ token: process.env.GITHUB_TOKEN})When running inside the GitHub Action, the hosting is provided automatically with the workflow’s token — no config entry needed.
Options
Section titled “Options”| Option | Description |
|---|---|
token | GitHub personal access token to authenticate with the GitHub API. |
octokit | Alternative to token — an instance of GitHub’s Octokit client. |
Behavior
Section titled “Behavior”- One GitHub release is created per released package: a single
vX.Y.Zrelease for regular projects and fixed monorepos, a release per package tag for independent monorepos. - Release notes are taken from the generated changelog section.
- Prereleases are marked as Pre-release.
- Releases of previous majors — for example from a maintenance branch — are not marked as the Latest release.
- Already existing releases are skipped, so a re-run does not create duplicates.