Skip to content

Commit

Permalink
ci: Add GitHub workflow to lint PR titles
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmg committed Aug 21, 2024
1 parent 1e01890 commit 4e545f6
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Lint PR Title

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: write

jobs:
main:
name: Lint PR Title
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
build
chore
ci
docs
feat
fix
iac
perf
refactor
revert
style
test
- uses: marocchino/[email protected]
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! 👋🏼
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.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/[email protected]
with:
header: pr-title-lint-error
delete: true

0 comments on commit 4e545f6

Please sign in to comment.