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

Commit e7e8acd

Browse files
committed
update PR job to comment when title needs to be updated
1 parent 79d8601 commit e7e8acd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/validate_pr.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,30 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: amannn/action-semantic-pull-request@v5
19+
id: lint_pr_title
1920
env:
2021
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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

0 commit comments

Comments
 (0)