https://github.com/maximousblk/prlog
Generate release notes based on GitHub Pull Requests
https://github.com/maximousblk/prlog
changelog cli release-notes releases
Last synced: about 2 months ago
JSON representation
Generate release notes based on GitHub Pull Requests
- Host: GitHub
- URL: https://github.com/maximousblk/prlog
- Owner: maximousblk
- License: mit
- Created: 2020-08-28T18:07:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-30T17:00:50.000Z (about 5 years ago)
- Last Synced: 2025-10-11T14:12:39.233Z (5 months ago)
- Topics: changelog, cli, release-notes, releases
- Language: TypeScript
- Homepage: https://deno.land/x/prlog
- Size: 18.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prlog
Generate release notes based on GitHub Pull Requests
## Install
You can install prlog using the following command.
```sh
deno install -A https://deno.land/x/prlog/prlog.ts
```
## Usage
```sh
prlog [start_tag] [end_tag] [options]
```
- `[start_tag]` - where to start counting changes. Defaults to last tag or first commit.
- `[end_tag]` - where to stop counting changes. Defaults to the last commit.
- `[options]`:
- `-t, --template` - location of the release notes template (default: undefined)
- `-o, --output` - location where to output generated release notes (default: undefined)
- `-v, --version` - version to use in release notes (default: "UNRELEASED")
- `-b, --branch` - name of the default branch of the repo (default: "master")
- `-m, --markdown` - use CommonMark spec instead of GitHub Flavoured Markdown
- `-a, --append` - append the out to an existing changelog instead of owerwriting it
- `--auth` - GitHub access token. Use this to avoid API rate limits and access private repositories
You can also use the `GITHUB_TOKEN` environment variable to use the GitHub access token.
### Templates
prlog can use any plaintext file for templates. Just use appropriate tags where you need them. If you don't define a template, prlog cli will output only a markdown list of pull requests.
Officially supported tags:
- `{{ VERSION }}` - release version
- `{{ CHANGELOG }}` - list of merged pull requests
Example :
```md
### {{ VERSION }}
{{ CHANGELOG }}
```
```sh
# /bin/sh
prlog denoland/deno -v 1.3.3 -t template.md -o changelog.md
```
```md
### 1.3.3
- docs(std/fs): remove stale references to readFileStr and writeFileStr (#7254)
- Typo in zsh env setup steps (#7250)
- upgrade: rust 1.46.0 (#7251)
```
### Plugins
In addition to using the CLI, you can build custom plugins for prlog.
Official plugins:
- [Version](plugins/Version.ts) - Set the release version. tag: `{{ VERSION }}`
- [SetDate](plugins/SetDate.ts) - Set date of release in desired format. tag: `{{ DATE }}`
- [CodeName](plugins/CodeName.ts) - Set a code name for the release. tag: `{{ CODENAME }}`
View [plugins](plugins) and [docs](https://doc.deno.land/https/deno.land/x/prlog/mod.ts) for more info.
Example:
```ts
// release.ts
import prlog from "https://deno.land/x/prlog/mod.ts";
import "https://deno.land/x/prlog/plugins/SetDate.ts";
import "https://deno.land/x/prlog/plugins/Version.ts";
const template: string = `
# {{ VERSION }} / {{ DATE }}
{{ CHANGELOG }}
`;
const changelog: string = (await prlog(template, "denoland/deno"))
.prlogSetDate()
.prlogVersion("1.3.3");
console.log(changelog);
/*
$ deno run -A release.ts
### 1.3.3 / 02 09 2020
- docs(std/fs): remove stale references to readFileStr and writeFileStr (#7254)
- Typo in zsh env setup steps (#7250)
- upgrade: rust 1.46.0 (#7251)
*/
```
## License
This software is released under [The MIT License](LICENSE)