Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields
Switch branches/tags
Nothing to show
Clone or download
Latest commit 986ae4b Dec 2, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig Init Dec 2, 2018
.gitattributes Init Dec 2, 2018
.gitignore Init Dec 2, 2018
.npmrc Init Dec 2, 2018
.travis.yml Init Dec 2, 2018
example.js Init Dec 2, 2018
index.js Init Dec 2, 2018
license Init Dec 2, 2018
package.json 0.1.0 Dec 2, 2018
readme.md Init Dec 2, 2018
test.js Init Dec 2, 2018

readme.md

new-github-release-url Build Status

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.

Install

$ npm install new-github-release-url

Usage

const newGithubReleaseUrl = require('new-github-release-url');
const opn = require('opn');

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
opn(url);

API

newGithubReleaseUrl(options)

Returns a URL string.

options

Type: Object

You are required to either specify the repoUrl option or both the user and repo options.

repoUrl

Type: string

The full URL to the repo.

user

Type: string

GitHub username or organization.

repo

Type: string

GitHub repo.

tag

Type: string

The tag name of the release.

target

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.

title

Type: string

The title of the release.

GitHub shows the tag name when not specified.

body

Type: string

The description text of the release.

isPrerelease

Type: boolean
Default: false

Whether the release should be marked as a pre-release.

Related

  • new-github-issue-url - Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields

License

MIT © Sindre Sorhus