-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yaml
More file actions
30 lines (27 loc) · 938 Bytes
/
action.yaml
File metadata and controls
30 lines (27 loc) · 938 Bytes
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
name: Commit message standards checks
description: Check the integrity of commit messages against Space ROS project standards
runs:
using: composite
steps:
- name: Un-shallow the git history so we can poke around in it
run: git fetch --unshallow
shell: bash
- name: Support forks by grabbing the commit history from the PR branch
run: git fetch origin pull/${{ github.event.number }}/head:updated_head_ref
shell: bash
- name: Check that every commit name includes an issue reference like "#1"
run: |
set -eo pipefail
IFS=$'\n'
commits=$(git log --oneline origin/${{github.base_ref}}..updated_head_ref)
for commit in $commits
do
if [[ $commit =~ ^.*#[0-9]+.*$ ]];
then
continue
else
echo "Found commit with no issue number: $commit"
exit 1
fi
done
shell: bash