Skip to content

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/github
release.js
import { 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:

.simple-release.js
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.

OptionDescription
tokenGitHub personal access token to authenticate with the GitHub API.
octokitAlternative to token — an instance of GitHub’s Octokit client.
  • One GitHub release is created per released package: a single vX.Y.Z release 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.