ci: add pr lints (#655)
* add pr lints
* fix commitlint
* checkout the project
* switch to coventional-pr-title-action
* use pull_request instead
* fix commenting
* fix perms
* switch to pull_request_target
diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml
new file mode 100644
index 0000000..fdd9dfd
--- /dev/null
+++ b/.github/workflows/check-pr-title.yml
@@ -0,0 +1,33 @@
+name: check-pr-title
+on:
+ pull_request_target:
+ types:
+ - opened
+ - reopened
+ - edited
+ - synchronize
+
+jobs:
+ conventional-commit:
+ runs-on: ubuntu-latest
+ permissions:
+ statuses: write
+ pull-requests: write
+ steps:
+ - uses: aslafy-z/conventional-pr-title-action@v3
+ id: pr-title-lint
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - uses: marocchino/sticky-pull-request-comment@v2.8.0
+ if: failure()
+ with:
+ header: commitlint-pr-title
+ message: ${{ steps.pr-title-lint.outputs.error }}
+ recreate: true
+
+ - uses: marocchino/sticky-pull-request-comment@v2.8.0
+ if: success()
+ with:
+ header: commitlint-pr-title
+ delete: true