Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/new-github-release-url
Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields
https://github.com/sindresorhus/new-github-release-url
github github-releases npm-package release-automation url
Last synced: 4 days ago
JSON representation
Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields
- Host: GitHub
- URL: https://github.com/sindresorhus/new-github-release-url
- Owner: sindresorhus
- License: mit
- Created: 2018-12-02T14:43:47.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T16:02:04.000Z (over 1 year ago)
- Last Synced: 2025-01-11T03:16:10.943Z (11 days ago)
- Topics: github, github-releases, npm-package, release-automation, url
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 121
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-list - new-github-release-url
README
# new-github-release-url
> 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](https://github.com/isaacs/github/issues/1410#issuecomment-442240267). This package simplifies generating such URL.
## Install
```sh
$ npm install new-github-release-url
```## Usage
```js
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);
```## 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 branchThe 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](https://github.com/sindresorhus/new-github-issue-url) - Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields