-
-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (37 loc) · 1.19 KB
/
commit-check.yml
File metadata and controls
41 lines (37 loc) · 1.19 KB
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
35
36
37
38
39
40
41
name: Commit Check
on:
pull_request:
branches: 'main'
workflow_dispatch:
jobs:
commit-check:
runs-on: ubuntu-latest
permissions: # use permissions because of use pr-comments
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit
fetch-depth: 0 # fetch all history for all branches and tags
- uses: ./ # self test
id: commit-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because of use pr-comments
with:
message: true
branch: true
author-name: true
author-email: true
commit-signoff: true
merge-base: true
imperative: true
job-summary: true
pr-comments: ${{ github.event_name == 'pull_request' }}
- name: Save PR comments to pr-comments.txt
run: echo "${{ steps.commit-check.outputs.pr_comments }}" > pr-comments.txt
- name: Upload pr-comments.txt
uses: actions/upload-artifact@v4
with:
name: commit-check-pr-comments
path: pr-comments.txt