Skip to content

Commit 13972a6

Browse files
authored
Update pr.yml
1 parent a5bece5 commit 13972a6

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

.github/workflows/pr.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
name: Pull Request Checker
2-
on:
3-
pull_request:
4-
branches:
5-
- main
1+
name: Commitlint
62

7-
permissions:
8-
pull-requests: read
3+
on: [pull_request]
94

105
jobs:
116
commitlint:
@@ -14,17 +9,9 @@ jobs:
149
- uses: actions/checkout@v3
1510
with:
1611
fetch-depth: 0
17-
- uses: actions/setup-node@v2
12+
- uses: actions/setup-node@v3
1813
with:
19-
node-version: '16' # 更新 Node.js 版本到 16
20-
- run: npm install
21-
- run: |
22-
npm install --save-dev @commitlint/config-angular @commitlint/cli
23-
echo "module.exports = {extends: ['@commitlint/config-angular']};" > commitlint.config.js
24-
- run: npx commitlint --from=HEAD~1 --to=HEAD --verbose
25-
- name: Check if the PR close an issue in PR body
26-
run: |
27-
if ! echo "${{ github.event.pull_request.body }}" | grep -q "close" ; then
28-
echo "No issue closed in the PR body. Please add a line like 'close #123' to the PR body."
29-
exit 1
30-
fi
14+
node-version: '16'
15+
- run: npm install -g @commitlint/cli @commitlint/config-conventional
16+
- run: echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
17+
- run: commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 commit comments

Comments
 (0)