-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.51 KB
/
commit-message-check.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Commit Message Check
run-name: CommitMessageCheck
on:
pull_request:
types: [opened, edited, reopened, synchronize]
branches: main
concurrency:
group: 'check_commit'
cancel-in-progress: true
jobs:
check-commit-message:
name: Check commit messages
environment: github-pages
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.CHECK_COMMIT_GITHUB_TOKEN }}
- name: Setup variables
run: |
documentationUrl=$(cat ./public/CNAME)
echo "DOCUMENTATION_URL=${documentationUrl}" >> $GITHUB_ENV
# - name: Check PR commits
# run: |
# echo ${{ steps.get-pr-commits.outputs.commits }} > ./commits.json
# cat ./commits.json
# commits = ${{ steps.get-pr-commits.outputs.commits }}
# for value in "${commits[@]}"
# do
# echo "Value for item array is: $value"
# done
- name: Post PR Comment
if: failure()
uses: mshick/add-pr-comment@v2
with:
message: Please check the commit messages in this PR! It seems that you have not used emojis, this is a requirement for this project as per our documentation ${{ env.DOCUMENTATION_URL }}
refresh-message-position: true
allow-repeats: true