Skip to content

Commit d8e5118

Browse files
committed
Improve semantic PR workflow
1 parent 41a4031 commit d8e5118

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/semantic.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,41 @@ on:
66
- opened
77
- edited
88
- synchronize
9+
- reopened
10+
11+
permissions:
12+
pull-requests: read
913

1014
jobs:
1115
main:
1216
name: Validate PR title
1317
runs-on: ubuntu-latest
1418
steps:
1519
- uses: amannn/action-semantic-pull-request@v5
20+
id: lint_pr_title
1621
env:
1722
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- uses: marocchino/sticky-pull-request-comment@v2
25+
# When the previous steps fails, the workflow would stop. By adding this
26+
# condition you can continue the execution with the populated error message.
27+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
28+
with:
29+
header: pr-title-lint-error
30+
message: |
31+
Hey there and thank you for opening this pull request! 👋🏼
32+
33+
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.
34+
35+
Details:
36+
37+
```
38+
${{ steps.lint_pr_title.outputs.error_message }}
39+
```
40+
41+
# Delete a previous comment when the issue has been resolved
42+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
43+
uses: marocchino/sticky-pull-request-comment@v2
44+
with:
45+
header: pr-title-lint-error
46+
delete: true

0 commit comments

Comments
 (0)