Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields
GitHub supports prefilling a new release by setting certain search parameters. This package simplifies generating such URL.
$ npm install new-github-release-url
import newGithubReleaseUrl from 'new-github-release-url';
import open from 'open';
const url = newGithubReleaseUrl({
user: 'sindresorhus',
repo: 'new-github-release-url',
body: '\n\n\n---\nI\'m a human. Please be nice.'
});
//=> 'https://github.com/sindresorhus/new-github-release-url/releases/new?body=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.'
// Then open it
await open(url);
Returns a URL string.
Type: object
You are required to either specify the repoUrl
option or both the user
and repo
options.
Type: string
The full URL to the repo.
Type: string
GitHub username or organization.
Type: string
GitHub repo.
Type: string
The tag name of the release.
Type: string
Default: The default branch
The branch name or commit SHA to point the release's tag at, if the tag doesn't already exist.
Type: string
The title of the release.
GitHub shows the tag
name when not specified.
Type: string
The description text of the release.
Type: boolean
Default: false
Whether the release should be marked as a pre-release.
- new-github-issue-url - Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields