Skip to content

Commit addbf06

Browse files
authored
chore(github-actions): configure commitlint to lint the PR title (#1060)
* configure commitlint to lint the PR title * docs(components): update CONTRIBUTING.md * chore(components): remove changelog preview * chore(components): remove obsolete commands
1 parent 4e00fc3 commit addbf06

4 files changed

Lines changed: 8 additions & 68 deletions

File tree

.github/workflows/changelog-preview.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/commitlint.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
commitlint:
8-
name: Lint commit messages
8+
name: Lint PR title format
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v6
@@ -24,5 +24,8 @@ jobs:
2424
- name: Install npm packages
2525
run: npm ci
2626

27-
- name: Validate PR commits with commitlint
28-
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --verbose
27+
- name: Lint PR title
28+
env:
29+
PR_TITLE: ${{ github.event.pull_request.title }}
30+
run: |
31+
echo "$PR_TITLE" | npx commitlint --verbose

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ commit messages should follow the Conventional Commits specification.
1616
If you don't mean for a `feat` or `fix` commit to show up in the components change list,
1717
then you must not edit files in `components/` in the same commit.
1818

19+
We squash-merge PRs, so only the PR title needs to follow this format.
20+
1921
### Testing The Generated Changelog
2022

2123
To test the generated changelog, run

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
"release-please": "^17.1.2"
1212
},
1313
"scripts": {
14-
"commitlint:last-commit": "commitlint --from=HEAD~1 --verbose",
15-
"commitlint:merge-base": "commitlint --from=$(git merge-base HEAD main) --verbose",
1614
"release-please-dry-run": "release-please release-pr --dry-run --config-file=components/release-please-config.json --manifest-file=components/.release-please-manifest.json --repo-url='https://github.com/GenSpectrum/dashboard-components' --path components",
1715
"release-please-changelog-preview": ".github/scripts/preview-changelog.sh"
1816
}

0 commit comments

Comments
 (0)