Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Commit 472664c

Browse files
authored
Fix pr title checking action (#91)
1 parent 7195088 commit 472664c

File tree

4 files changed

+62
-480
lines changed

4 files changed

+62
-480
lines changed
Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Check PR Title'
1+
name: 'Lint PR'
22

33
on:
44
pull_request_target:
@@ -7,13 +7,39 @@ on:
77
- edited
88
- synchronize
99

10+
permissions: write-all
11+
1012
jobs:
11-
check-pr-title:
12-
name: 🔡 Check PR Title
13+
validate_pr_title:
14+
name: Validate PR title
1315
runs-on: ubuntu-latest
1416
steps:
15-
- uses: amannn/action-semantic-pull-request@25e3275e19cd5b3577a99478084255065002897c
17+
- uses: amannn/action-semantic-pull-request@v5
1618
env:
1719
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1820
with:
19-
requireScope: true
21+
wip: true
22+
23+
- uses: marocchino/sticky-pull-request-comment@v2
24+
# When the previous steps fails, the workflow would stop. By adding this
25+
# condition you can continue the execution with the populated error message.
26+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
27+
with:
28+
header: pr-title-lint-error
29+
message: |
30+
Hey there and thank you for opening this pull request! 👋🏼
31+
32+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
33+
34+
Details:
35+
36+
```
37+
${{ steps.lint_pr_title.outputs.error_message }}
38+
```
39+
40+
# Delete a previous comment when the issue has been resolved
41+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
42+
uses: marocchino/sticky-pull-request-comment@v2
43+
with:
44+
header: pr-title-lint-error
45+
delete: true

.husky/prepare-commit-msg

Lines changed: 0 additions & 4 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
"name": "Mateusz Łopaciński",
77
"email": "lop.mateusz.2001@gmail.com"
88
},
9-
"config": {
10-
"commitizen": {
11-
"path": "./node_modules/cz-conventional-changelog"
12-
}
13-
},
149
"dependencies": {
1510
"@fortawesome/fontawesome-svg-core": "^6.4.0",
1611
"@fortawesome/free-solid-svg-icons": "^6.4.0",
@@ -34,8 +29,6 @@
3429
"babel-jest": "^29.5.0",
3530
"babel-plugin-module-resolver": "^5.0.0",
3631
"babel-plugin-react-require": "^4.0.0",
37-
"commitizen": "^4.3.0",
38-
"cz-conventional-changelog": "^3.3.0",
3932
"eslint": "^8.41.0",
4033
"eslint-import-resolver-typescript": "^3.5.5",
4134
"eslint-plugin-import": "^2.27.5",
@@ -91,7 +84,6 @@
9184
"android": "react-native run-android",
9285
"build": "yarn clean && bob build && yarn declarations:emit",
9386
"clean": "rm -rf dist && rm -f *.tgz",
94-
"commit": "cz",
9587
"declarations:emit": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
9688
"format:code": "prettier --write .",
9789
"format:deps": "syncpack format",

0 commit comments

Comments
 (0)