forked from kumahq/kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (34 loc) · 1.26 KB
/
check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: "Lint PRs"
on:
pull_request:
types:
- edited
- opened
- reopened
- synchronized
jobs:
# This job checks the PR title using
# https://github.com/conventional-changelog/commitlint
# for the conventional commit format at
# https://www.conventionalcommits.org/en/v1.0.0/
# See also /.github/commitlint.config.js for more details
# We only need to check the PR title because it will end up being the
# (default) commit title when doing squash merges with Github.
# See
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#merge-message-for-a-squash-merge
# for more info. We have "Default to PR title for squash merge commits" enabled.
commit-lint:
name: "Check PR title"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- run: npm install -g @commitlint/cli @commitlint/config-conventional
- name: "Check PR title"
# Inject as env variable to escape properly
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
commitlint --config .github/commitlint.config.js --edit=<(echo "${TITLE}")