Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion .github/workflows/semantic-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
if: github.repository == 'wolfstar-project/plugins'
permissions:
contents: read
pull-requests: read
pull-requests: write # read the PR and post or delete the sticky comment
statuses: write
steps:
- name: Validate PR title
id: lint_pr_title
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
with:
types: |
Expand Down Expand Up @@ -64,3 +65,27 @@ jobs:
does not start with an uppercase character.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
# When the previous step fails, the workflow would stop. This condition
# keeps it going so the error message can be posted.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

Pull request titles need to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/), and it looks like this one needs a small adjustment.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```

# Delete the previous comment once the title has been fixed
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
header: pr-title-lint-error
delete: true
Loading