-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support gitlab, gitea, and bitbucket for git-cliff (#208)
fixes #188 BREAKING CHANGE: `--github-repo` has been renamed to `--git-repo` BREAKING CHANGE: `githubRepo` has been renamed to `gitRepo` BREAKING CHANGE: `--github-token` has been renamed to `gitToken` BREAKING CHANGE: `githubToken` has been renamed to `gitToken` BREAKING CHANGE: The environment variables `TOKEN_GITHUB` and `TOKEN_GH` are no longer supported BREAKING CHANGE: environment variables `GITLAB_TOKEN`, `GITEA_TOKEN`, and `BITBUCKET_TOKEN` are now supported for `--git-token` BREAKING CHANGE: A new option `--git-host-variant` was added, which defaults to `'github'`. To release to GitHub, this has to be set to `'github'`.
- Loading branch information
Showing
10 changed files
with
168 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,18 +105,15 @@ Options: | |
Defaults to "chore({{name}}): release {{full-name}}@{{new-version}}" | ||
You can use "{{new-version}}" in your template which will be dynamically replaced with whatever the new version is that will be published. | ||
You can use "{{name}}" in your template, this will be replaced with the name provided through "-n", "--name" or the same value set in your config file. | ||
You can use "{{full-name}}" in your template, this will be replaced "{{name}}" (when "org" is not provided), or "@{{org}}/{{name}}" (when "org" is | ||
provided). | ||
You can use "{{full-name}}" in your template, this will be replaced "{{name}}" (when "org" is not provided), or "@{{org}}/{{name}}" (when "org" is provided). | ||
--tag-template [string] A custom tag template to use. | ||
When "org" is provided this will default to "@{{org}}/{{name}}@{{new-version}}", for example "@favware/[email protected]" | ||
When "org" is not provided this will default to "v{{new-version}}", for example "v1.0.0" | ||
You can use "{{new-version}}" in your template which will be dynamically replaced with whatever the new version is that will be published. | ||
You can use "{{org}}" in your template, this will be replaced with the org provided through "-o", "--org" or the same value set in your config file. | ||
You can use "{{name}}" in your template, this will be replaced with the name provided through "-n", "--name" or the same value set in your config file. | ||
You can use "{{full-name}}" in your template, this will be replaced "{{name}}" (when "org" is not provided), or "@{{org}}/{{name}}" (when "org" is | ||
provided). | ||
-i, --install Whether to run npm install after bumping the version but before committing and creating a git tag. This is useful when you have a mono repo where bumping | ||
one package would then cause the lockfile to be out of date. | ||
You can use "{{full-name}}" in your template, this will be replaced "{{name}}" (when "org" is not provided), or "@{{org}}/{{name}}" (when "org" is provided). | ||
-i, --install Whether to run npm install after bumping the version but before committing and creating a git tag. This is useful when you have a mono repo where bumping one package would then cause the lockfile to be out of date. | ||
--skip-changelog Whether to skip updating your changelog file | ||
default "true" when CI=true, "false" otherwise | ||
--no-skip-changelog Whether to skip updating your changelog file | ||
|
@@ -127,39 +124,43 @@ Options: | |
default "true" when CI=true, "false" otherwise | ||
-cpf, --changelog-prepend-file [string] The file that git-cliff should use for the --prepend flag, defaults to ./CHANGELOG.md. This should be relative to the current working directory. | ||
--skip-commit [skipCommit...] Repeatable, each will be treated as a new entry. A list of SHA1 commit hashes that will be skipped in the changelog. | ||
--github-repo The GitHub repository to use for linking to issues and PRs in the changelog. | ||
--git-host-variant The git host variant. Git-cliff supports 4 hosting websites, GitHub, GitLab, Gitea, and BitBucket. By setting this option you control which api is used by git-cliff. Defaults to "github" for backwards compatibility. | ||
--git-repo The git repository to use for linking to issues and PRs in the changelog. | ||
You can pass the unique string "auto" to automatically set this value as {{org}}/{{name}} as provided from --org and --name | ||
This should be in the format "owner/repo" | ||
You can use the "GITHUB_REPO" environment variable to automatically set this value | ||
--github-token A token to authenticate requests to the GitHub API. This is required when using the "--github-repo" option. | ||
You can use the "GIT_REPO" environment variable to automatically set this value | ||
--git-token A token to authenticate requests to the Git host API. This can be a GitHub, GitLab, Gitea, or BitBucket token. Which is used is determined by "--git-host-variant". This is required when using the "--git-repo" option. | ||
You can also set the one of the following environment variables. | ||
- GITHUB_TOKEN | ||
- GITLAB_TOKEN | ||
- GITEA_TOKEN | ||
- BITBUCKET_TOKEN | ||
- GH_TOKEN | ||
- TOKEN_GITHUB | ||
- TOKEN_GH | ||
The multiple options for the name of the environment are to aim to not conflict with other tooling that use similar tokens in case you want to use a unique | ||
token for release management. | ||
-pt, --push-tag Whether to push the tag to the remote repository. | ||
This will simply execute "git push && git push --tags" so make sure you have configured git for pushing properly beforehand. | ||
-npt, --no-push-tag Whether to push the tag to the remote repository. | ||
This will simply execute "git push && git push --tags" so make sure you have configured git for pushing properly beforehand. | ||
-ghr, --github-release Whether to create a release on GitHub, requires "--push-tag" to be enabled, otherwise there will be no tag to create a release from | ||
For the repository the release is created on the value from "--github-repo" will be used | ||
-ghr, --github-release Note that this is only supported if "--git-host-variant" is set to "github" | ||
Whether to create a release on GitHub, requires "--push-tag" to be enabled, otherwise there will be no tag to create a release from | ||
For the repository the release is created on the value from "--git-repo" will be used | ||
If the changelog section from git-cliff is empty, the release notes will be auto-generated by GitHub. | ||
-nghr, --no-github-release Whether to create a release on GitHub, requires "--push-tag" to be enabled, otherwise there will be no tag to create a release from | ||
For the repository the release is created on the value from "--github-repo" will be used | ||
-nghr, --no-github-release Note that this is only supported if "--git-host-variant" is set to "github" | ||
Whether to create a release on GitHub, requires "--push-tag" to be enabled, otherwise there will be no tag to create a release from | ||
For the repository the release is created on the value from "--git-repo" will be used | ||
If the changelog section from git-cliff is empty, the release notes will be auto-generated by GitHub. | ||
-ghrd, --github-release-draft Whether the release should be a draft | ||
-ghrpr, --github-release-pre-release Whether the release should be a pre-release | ||
-ghrl, --github-release-latest Whether the release should be marked as the latest release, will try to read this value, then the value of --github-release, and then default to false. | ||
Please note that when setting --github-release-pre-release to `true` GitHub will prevent the release to be marked as latest an this option will essentially | ||
be ignored. | ||
-ghrnt, --github-release-name-template [string] A GitHub release name template to use. Defaults to an empty string, which means GitHub will use the tag name as the release name. | ||
-ghrd, --github-release-draft Note that this is only supported if "--git-host-variant" is set to "github" | ||
Whether the release should be a draft | ||
-ghrpr, --github-release-pre-release Note that this is only supported if "--git-host-variant" is set to "github" | ||
Whether the release should be a pre-release | ||
-ghrl, --github-release-latest Note that this is only supported if "--git-host-variant" is set to "github" | ||
Whether the release should be marked as the latest release, will try to read this value, then the value of --github-release, and then default to false. Please note that when setting --github-release-pre-release to `true` GitHub will prevent the release to | ||
be marked as latest an this option will essentially be ignored. | ||
-ghrnt, --github-release-name-template [string] Note that this is only supported if "--git-host-variant" is set to "github" | ||
A GitHub release name template to use. Defaults to an empty string, which means GitHub will use the tag name as the release name. | ||
You can use "{{new-version}}" in your template which will be dynamically replaced with whatever the new version is that will be published. | ||
You can use "{{org}}" in your template, this will be replaced with the org provided through "-o", "--org" or the same value set in your config file. | ||
You can use "{{name}}" in your template, this will be replaced with the name provided through "-n", "--name" or the same value set in your config file. | ||
You can use "{{full-name}}" in your template, this will be replaced "{{name}}" (when "org" is not provided), or "@{{org}}/{{name}}" (when "org" is | ||
provided). | ||
You can use "{{full-name}}" in your template, this will be replaced "{{name}}" (when "org" is not provided), or "@{{org}}/{{name}}" (when "org" is provided). | ||
-v, --verbose Whether to print verbose information (default: false) | ||
-h, --help display help for command | ||
``` | ||
|
@@ -186,8 +187,9 @@ package). It should be named `.cliff-jumperrc`, optionally suffixed with | |
- `--skip-tag` and `--no-skip-tag` map to `skipTag` | ||
- `--changelog-prepend-file` maps to `changelogPrependFile` | ||
- `--skip-commit` maps to `skipCommit` | ||
- `--github-repo` maps to `githubRepo` | ||
- `--github-token` maps to `githubToken` | ||
- `--git-host-variant` maps to `gitHostVariant` | ||
- `--git-repo` maps to `gitRepo` | ||
- `--git-token` maps to `gitToken` | ||
- `--push-tag` and `--no-push-tag` map to `pushTag` | ||
- `--github-release` and `--no-github-release` map to `githubRelease` | ||
- `--github-release-draft` maps to `githubReleaseDraft` | ||
|
@@ -272,8 +274,9 @@ This library has opinionated defaults for its options. These are as follows: | |
provided), or `@{{org}}/{{name}}` (when `org` is provided). | ||
- `--changelog-prepend-file` will default to `./CHANGELOG.md`. | ||
- `--skip-commit` will default to `[]` (an empty array). | ||
- `--github-repo` will default to `undefined`. | ||
- `--github-token` will default to `undefined`. | ||
- `--git-host-variant` will default to `'github'`. | ||
- `--git-repo` will default to `undefined`. | ||
- `--git-token` will default to `undefined`. | ||
- `--push-tag` will default to `false`. Alternatively you can force this to | ||
false by providing `--no-push-tag`. | ||
- `--github-release` will default to `false`. Alternatively you can force this | ||
|
@@ -304,9 +307,9 @@ such as in a CI environment. | |
This package provides the options `--push-tag` and `--github-release` to | ||
automatically create a release on GitHub using the output from `git-cliff` as | ||
the release notes. In order to use this feature you have to provide | ||
`--github-repo` and `--github-token` (or set their respective environment | ||
variables). Alternatively, if you want to run this step from a GitHub workflow | ||
you can base your step on the following example. | ||
`--git-host-variant=github`, `--git-repo`, and `--git-token` (or set the latter | ||
respective environment variables). Alternatively, if you want to run this step | ||
from a GitHub workflow you can base your step on the following example. | ||
It is very important that if your main branch is protected by branch protection | ||
you have to provide a Personal Access Token (this can be both a classic or a | ||
|
@@ -360,7 +363,7 @@ example. Replace the values in between `<>` with your desired values. | |
name: <package-name> | ||
packagePath: . | ||
pushTag: true | ||
githubRepo: <repo-owner>/<repo-name> | ||
gitRepo: <repo-owner>/<repo-name> | ||
githubRelease: true | ||
githubReleaseLatest: true | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.