Skip to content

Commit 4313deb

Browse files
committed
ci: move commitlint to separate workflow
1 parent 9c2dee4 commit 4313deb

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: CI
33
on:
44
push:
55
pull_request:
6-
pull_request_target:
7-
types: [opened, reopened, synchronize]
86

97
concurrency:
108
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -15,24 +13,6 @@ env:
1513
COMPOSER_ROOT_VERSION: "4.1.x-dev"
1614

1715
jobs:
18-
commitlint:
19-
if: github.event_name == 'pull_request_target'
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
with:
24-
fetch-depth: 0
25-
- name: Run commitlint
26-
run: |
27-
base_sha="${{ github.event.pull_request.base.sha }}"
28-
head_sha="${{ github.event.pull_request.head.sha }}"
29-
first_commit_sha=$(git rev-list --no-merges --reverse $base_sha..$head_sha | head -n 1)
30-
commit_message=$(git log -1 --pretty=%B $first_commit_sha)
31-
# we can't use npx see https://github.com/conventional-changelog/commitlint/issues/613
32-
echo '{}' > package.json
33-
npm install --no-fund --no-audit @commitlint/config-conventional @commitlint/cli
34-
echo "$commit_message" | ./node_modules/.bin/commitlint -g .commitlintrc
35-
3616
architecture:
3717
name: Check components interdependencies
3818
runs-on: ubuntu-latest

.github/workflows/commitlint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Commit Lint
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, synchronize]
6+
7+
jobs:
8+
commitlint:
9+
if: github.event_name == 'pull_request_target'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Run commitlint
16+
run: |
17+
base_sha="${{ github.event.pull_request.base.sha }}"
18+
head_sha="${{ github.event.pull_request.head.sha }}"
19+
first_commit_sha=$(git rev-list --no-merges --reverse $base_sha..$head_sha | head -n 1)
20+
commit_message=$(git log -1 --pretty=%B $first_commit_sha)
21+
# we can't use npx see https://github.com/conventional-changelog/commitlint/issues/613
22+
echo '{}' > package.json
23+
npm install --no-fund --no-audit @commitlint/config-conventional @commitlint/cli
24+
echo "$commit_message" | ./node_modules/.bin/commitlint -g .commitlintrc
25+
File renamed without changes.

0 commit comments

Comments
 (0)