Skip to content

Commit

Permalink
Merge pull request #59 from pmowrer/semantic-release-version
Browse files Browse the repository at this point in the history
Semantic release version
  • Loading branch information
pmowrer committed Jan 16, 2024
2 parents 0269fde + 68eaf9a commit ce9965a
Show file tree
Hide file tree
Showing 3 changed files with 935 additions and 1,063 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ E.g., in a `package.json` release config:

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.

#### GitHub Actions
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):

```yaml
- run: git checkout -b ${{ github.head_ref }}
- run: unset GITHUB_ACTIONS && npx semantic-release-github-pr
```

#### Travis

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/).
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
"bin": "./bin/semantic-release-github-pr.js",
"license": "MIT",
"peerDependencies": {
"semantic-release": ">=16.0.0"
"semantic-release": ">=16.0.0 < 20"
},
"dependencies": {
"debug": "^4.1.1",
"env-ci": "^5.0.1",
"execa": "^4.0.0",
"github": "^13.0.0",
"parse-github-url": "^1.0.2",
Expand All @@ -33,7 +32,7 @@
"jest": "^25.1.0",
"lint-staged": "^10.0.3",
"prettier": "^1.19.1",
"semantic-release": "^17.0.0"
"semantic-release": "^19"
},
"husky": {
"hooks": {
Expand Down
Loading

0 comments on commit ce9965a

Please sign in to comment.