Skip to content

Commit e2368f6

Browse files
committed
docs: Update README
1 parent 362acc8 commit e2368f6

File tree

1 file changed

+35
-19
lines changed

1 file changed

+35
-19
lines changed

README.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,69 @@ you'll need to configure that workflow yourself. You can look to the
1616

1717
- Check for the latest version number published to npm.
1818
- Lookup all commits between the git commit that triggered the action and the latest publish.
19-
- If the package hasn't been published or the prior publish does not include a git hash, we'll
20-
only pull the commit data that triggered the action.
21-
- Based on the commit messages, increment the version from the lastest release.
22-
- If the strings "BREAKING CHANGE" or "!:" are found anywhere in any of the commit messages or descriptions the major
23-
version will be incremented.
24-
- If a commit message begins with the string "feat" then the minor version will be increased. This works
25-
for most common commit metadata for feature additions: `"feat: new API"` and `"feature: new API"`.
19+
- Note: The package needs to have an initial publish in order to pull the package details.
20+
- Based on the commit messages, increment the version from the latest release.
21+
- If the strings "BREAKING CHANGE" is found anywhere in any of the commit messages, or "!:" is found in the first line or a commit message starts with one of the provided major tags (optional), then the major version will be incremented.
22+
- If a commit message begins with the string "feat" (or a tag in the minor tags list) then the minor version will be increased. This works for most common commit metadata for feature additions: `"feat: new API"` and `"feature: new API"`.
2623
- All other changes will increment the patch version.
27-
- Publish to npm using the configured token.
24+
- Publish to npm (or the provided registry url) using the configured token.
2825
- Push a tag for the new version to GitHub.
2926

3027
### Configuration
3128

32-
You can configure some aspects of merge-release action by passing some environmental variables.
29+
You can configure some aspects of merge-release action by using the `with` properties on the action or passing some environmental variables.
3330

3431
- **GITHUB_TOKEN (required)**
3532
- Github token to allow tagging the version.
3633
- **NPM_AUTH_TOKEN (required)**
37-
- NPM Auth Token to publish to NPM, read [here](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) how to setup it as a secret.
34+
- NPM Auth Token to publish to the registry, read [here](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) how to setup it as a secret.
3835
- **DEPLOY_DIR**
39-
- The path where the dist `package.json` is to run npm publish. Defaults to the root dir.
36+
- The path where the dist `package.json` is to run npm publish. Defaults to the root dir. This is a relative file path, relative to the root of the repo.
4037
- **SRC_PACKAGE_DIR**
41-
- The path where the src package.json is found. Defaults to the root dir.
38+
- The path where the src `package.json` is found. Defaults to the root dir. This is a relative file path, relative to the root of the repo.
4239
- **NPM_REGISTRY_URL**
43-
- NPM Registry URL to use. defaults to: `https://registry.npmjs.org/`
40+
- NPM Registry URL to use. defaults to: `https://registry.npmjs.org/`. Set it to `https://npm.pkg.github.com` for GitHub Packages.
4441
- **NPM_PRIVATE**
4542
- If you wish privately publish your package please ensure you have set this to `true`
43+
- **DISABLE_GIT_TAG**
44+
- If you wish to skip setting the git tag, set this to `true`
45+
- **MAJOR_TAGS**
46+
- A list of tags to check for when considering whether to perform a major version update. The value is a list separated by the `|` character. i.e. `major|my-major-tag`
47+
- **MINOR_TAGS**
48+
- Override the list of tags to check for when considering whether to perform a minor version update. The value is a list separated by the `|` character. i.e. `feat|minor|my-minor-tag`
4649

47-
`merge-release` will use `npm publish` unless you've defined a `publish` script in your `package.json`.
50+
Note: `merge-release` will use `npm publish` by default; but if you've defined a `publish` script in your `package.json` it will use that instead.
51+
52+
## Examples
4853

4954
```yaml
50-
- uses: Github-Actions-Community/merge-release@main
51-
env:
55+
- name: Publish to NPM
56+
uses: Github-Actions-Community/merge-release@main
57+
with:
5258
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5359
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
5460
DEPLOY_DIR: my/deploy/dir
5561
SRC_PACKAGE_DIR: my/src/package
5662
```
5763
64+
```yaml
65+
- name: Publish to GitHub Packages
66+
uses: Github-Actions-Community/merge-release@main
67+
with:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
NPM_REGISTRY_URL: https://npm.pkg.github.com/
71+
MINOR_TAGS: feat|docs
72+
```
73+
5874
## Contributors ✨
5975
6076
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
6177
62-
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
6378
<!-- prettier-ignore-start -->
6479
<!-- markdownlint-disable -->
80+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
81+
6582
<table>
6683
<tbody>
6784
<tr>
@@ -73,11 +90,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
7390
</tbody>
7491
</table>
7592
93+
<!-- ALL-CONTRIBUTORS-LIST:END -->
7694
<!-- markdownlint-restore -->
7795
<!-- prettier-ignore-end -->
7896
79-
<!-- ALL-CONTRIBUTORS-LIST:END -->
80-
8197
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
8298
8399
##### Created my free [logo](https://logomakr.com/5sISSS) at [LogoMakr.com](LogoMakr.com)

0 commit comments

Comments
 (0)