github.com/honeycombio/honeytail@v1.9.0/.github/workflows/validate-pr-title.yml (about) 1 name: "Validate PR Title" 2 3 on: 4 pull_request: 5 types: 6 - opened 7 - edited 8 - synchronize 9 10 jobs: 11 main: 12 name: Validate PR title 13 runs-on: ubuntu-latest 14 steps: 15 - uses: amannn/action-semantic-pull-request@v5 16 id: lint_pr_title 17 name: "🤖 Check PR title follows conventional commit spec" 18 env: 19 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 with: 21 # Have to specify all types because `maint` and `rel` aren't defaults 22 types: | 23 maint 24 rel 25 fix 26 feat 27 chore 28 ci 29 docs 30 style 31 refactor 32 perf 33 test 34 ignoreLabels: | 35 "type: dependencies" 36 # When the previous steps fails, the workflow would stop. By adding this 37 # condition you can continue the execution with the populated error message. 38 - if: always() && (steps.lint_pr_title.outputs.error_message != null) 39 name: "📝 Add PR comment about using conventional commit spec" 40 uses: marocchino/sticky-pull-request-comment@v2 41 with: 42 header: pr-title-lint-error 43 message: | 44 Thank you for contributing to the project! 🎉 45 46 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. 47 48 Make sure to prepend with `feat:`, `fix:`, or another option in the list below. 49 50 Once you update the title, this workflow will re-run automatically and validate the updated title. 51 52 Details: 53 54 ``` 55 ${{ steps.lint_pr_title.outputs.error_message }} 56 ``` 57 58 # Delete a previous comment when the issue has been resolved 59 - if: ${{ steps.lint_pr_title.outputs.error_message == null }} 60 name: "❌ Delete PR comment after title has been updated" 61 uses: marocchino/sticky-pull-request-comment@v2 62 with: 63 header: pr-title-lint-error 64 delete: true