providerRelease()
Create the GitHub or GitLab releases from Node.js with providerRelease(), their notes optionally rewritten by AI, and read the posted releases.
ts
function providerRelease(options?: Partial<ProviderReleaseOptions>): Promise<ProviderReleaseResult>providerRelease() runs relizy provider-release. It returns the detectedProvider and the postedReleases (name, tag, version, prerelease). When the release fails, it does not throw: the result has an error message and no posted release (without provider, detectedProvider is github). It throws on an error of the config (an invalid or missing config file) and on a cancelled prompt (see Errors).
Options
The flags of relizy provider-release, camelCased, and the shared options:
| Option | Description |
|---|---|
bumpResult | BumpResultTruthy, the result of bump(): the releases of the bumped versions |
from, to | The commit range of the release notes |
provider | 'github' or 'gitlab', instead of the one detected from the origin remote |
token | Token of the git provider, overrides tokens |
ai | true or false forces or disables the AI rewrite of the notes, see AI |
safetyCheck | false skips the check of the token (and of the AI provider) |
force, suffix | Without bumpResult, as for bump() |
See ProviderReleaseOptions and ProviderReleaseResult.
Examples
ts
import { bump, providerRelease } from 'relizy'
const bumpResult = await bump({ yes: true })
if (bumpResult.bumped) {
// After the commit and the tags are pushed
const result = await providerRelease({ bumpResult })
if (result.error) {
console.error(`No ${result.detectedProvider} release: ${result.error}`)
}
}