Skip to content

Commit 1aa9e17

Browse files
authored
fix: Improve reporting for failed checks (#30)
* fix: Validate PR title before setting the status. * Don't show success message when PR title validation fails. * Use branch. * Log validation error. * More logging. * Try different event. * Shorter error message. * Add github release. * Remove logging. * Fix wording.
1 parent fc71bda commit 1aa9e17

File tree

8,452 files changed

+1840732
-12188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,452 files changed

+1840732
-12188
lines changed

.eslintrc.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This enables ESLint to use dependencies of this config
2+
// (see https://github.com/eslint/eslint/issues/3458)
3+
require('eslint-config-molindo/setupPlugins');
4+
5+
module.exports = {
6+
extends: 'molindo/javascript',
7+
env: {
8+
node: true,
9+
jest: true
10+
}
11+
};

.releaserc.json

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
}],
2121
"@semantic-release/release-notes-generator",
2222
["@semantic-release/changelog", {"changelogTitle": "# Changelog"}],
23+
["@semantic-release/github", {
24+
"successComment": false,
25+
"failComment": false,
26+
"failTitle": false,
27+
"releasedLabels": false
28+
}],
2329
["@semantic-release/git", {"message": "Release ${nextRelease.version}"}]
2430
]
2531
}

README.md

+19-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ This is a [Github Action](https://github.com/features/actions) that ensures that
44

55
This is helpful when you're using [semantic-release](https://github.com/semantic-release/semantic-release) with the Conventional Commits preset. When using the "Squash and merge" strategy, Github will suggest to use the PR title as the commit message. With this action you can validate that the PR title will lead to a correct commit message.
66

7-
## Example
7+
## Validation
8+
9+
Examples for valid PR titles:
10+
- fix: Correct typo.
11+
- feat: Add support for Node 12.
12+
- refactor!: Drop support for Node 6.
13+
14+
Note that since PR titles only have a single line, you have to use the `!` syntax for breaking changes.
15+
16+
See [Conventional Commits](https://www.conventionalcommits.org/) for more examples.
17+
18+
### Work in progress
19+
20+
Github has support for [draft pull requests](https://github.blog/2019-02-14-introducing-draft-pull-requests/), which will disable the merge button until the PR is marked as ready for merge.
21+
22+
However, [this feature might be disabled for your repository](https://github.community/t/draft-pull-requests-not-available/1753/7). In this case you can use the special `[WIP] ` prefix to indicate that a pull request is work in progress and isn't ready to be merged. This will avoid the validation of the PR title and the pull request checks remain pending.
23+
24+
## Example config
825

926
```yml
1027
name: "Lint PR"
@@ -24,15 +41,4 @@ jobs:
2441
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2542
```
2643
27-
Examples for valid PR titles:
28-
- fix: Correct typo.
29-
- feat: Add support for Node 12.
30-
- refactor!: Drop support for Node 6.
31-
32-
Note that since PR titles only have a single line, you have to use the `!` syntax for breaking changes.
33-
34-
See [Conventional Commits](https://www.conventionalcommits.org/) for more examples.
35-
36-
Additionally, the special `[WIP] ` prefix is supported, to indicate that a pull request is work in progress and isn't ready to be merged. In this case the PR title isn't validated and the pull request checks remain pending.
37-
38-
Note the usage of [`pull_request_target`](https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/) in place of `pull_request` as the event trigger is necessary for a fork-based workflow so the API token is valid for status reporting.
44+
Note the usage of [`pull_request_target`](https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/) as the event trigger is necessary for a fork-based workflow so the API token is valid for status reporting.

node_modules/.bin/eslint

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/gonzales

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/js-yaml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/json5

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/prettier

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/regexp-tree

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/rimraf

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/semver

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/tsc

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/tsserver

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.yarn-integrity

+196-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@babel/core/node_modules/.bin/json5

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)