Skip to content

Commit 8f76014

Browse files
committed
docs(README): Add GitHub Actions section
1 parent 0269fde commit 8f76014

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ E.g., in a `package.json` release config:
6767

6868
This plugin is best used with a CI build process to fully automate the posting of comments in Github PRs. Ideally, it should run whenever a PR is opened/updated.
6969

70+
#### GitHub Actions
71+
This plugin relies on `semantic-release`'s dry-run feature. Unfortunately, that feature is gated by strict run-time checks, including one that ensures that the branch `semantic-release` runs on is in the release configuration. It depends on [`env-ci`](https://github.com/semantic-release/env-ci) to enforce the checks in CI environments, which doesn't properly resolve the branch name when running in GitHub Actions, [requiring a workaround](https://github.com/semantic-release/semantic-release/issues/1890#issuecomment-974512960):
72+
73+
```yaml
74+
- run: git checkout -b ${{ github.head_ref }}
75+
- run: unset GITHUB_ACTIONS && npx semantic-release-github-pr
76+
```
77+
7078
#### Travis
7179
7280
To only run when necessary, we use the [`$TRAVIS_PULL_REQUEST`](https://docs.travis-ci.com/user/environment-variables/#Convenience-Variables) environment variable to detect whether the build is a ["pull request build"](https://docs.travis-ci.com/user/pull-requests/).

0 commit comments

Comments
 (0)