Skip to content

Commit

Permalink
chore: validate PR title (#32)
Browse files Browse the repository at this point in the history
as we generate the release notes from commit messages and we do squash
commits by PR title and description we have to validate the PR title
instead of the individual commit messages

Signed-off-by: Mario Constanti <[email protected]>
  • Loading branch information
bavarianbidi authored Mar 5, 2024
1 parent 5af37ce commit 04a3091
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ jobs:
with:
go-version: '1.21.5'

- name: make lint
run: make golangci-lint && GOLANGCI_LINT_EXTRA_ARGS=--timeout=1h make lint

- uses: actions/setup-node@v3
with:
node-version: 14

- name: make build
run: make build

Expand All @@ -38,16 +31,3 @@ jobs:

- name: make test
run: make test

- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
22 changes: 22 additions & 0 deletions .github/workflows/pull-request-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-License-Identifier: MIT

name: "lint Pull Request title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 04a3091

Please sign in to comment.