Skip to content

Commit 2f9bdb0

Browse files
committed
Enhance compliance workflow with improved bot and noreply email checks.
Signed-off-by: Alexander Adam <alphaone23@gmail.com>
1 parent 14d1aba commit 2f9bdb0

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/compliance.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ jobs:
8383
8484
# Skip commits from bots
8585
committer_name=`git log --format=%cn -n 1 "$sha"`
86-
if echo "$committer_name" | grep -Fq '[bot]' || [ "$committer_name" = "web-flow" ]
86+
committer_email=`git log --format=%ce -n 1 "$sha"`
87+
if echo "$committer_name" | grep -Fq '[bot]' \
88+
|| [ "$committer_name" = "web-flow" ] \
89+
|| echo "$committer_email" | grep -Eqi 'noreply@github\.com$|@users\.noreply\.github\.com$'
8790
then
88-
echo "Skipping bot/web-flow commit $sha from $committer_name"
91+
echo "Skipping commit $sha from $committer_name <$committer_email>"
8992
continue
9093
fi
9194
@@ -95,6 +98,11 @@ jobs:
9598
then
9699
echo "Commit $sha missing Signed-off-by"
97100
missing="true"
101+
102+
echo "Committer name: $committer_name"
103+
echo "Committer email: $committer_email"
104+
echo "github.actor: ${{ github.actor }}"
105+
echo "github.event.pusher.name: ${{ github.event.pusher.name }}"
98106
fi
99107
done < shas.txt
100108
@@ -147,9 +155,12 @@ jobs:
147155
148156
# Skip commits from bots
149157
committer_name=`git log --format=%cn -n 1 "$sha"`
150-
if echo "$committer_name" | grep -Fq '[bot]' || [ "$committer_name" = "web-flow" ]
158+
committer_email=`git log --format=%ce -n 1 "$sha"`
159+
if echo "$committer_name" | grep -Fq '[bot]' \
160+
|| [ "$committer_name" = "web-flow" ] \
161+
|| echo "$committer_email" | grep -Eqi 'noreply@github\.com$|@users\.noreply\.github\.com$'
151162
then
152-
echo "Skipping bot/web-flow commit $sha from $committer_name"
163+
echo "Skipping commit $sha from $committer_name <$committer_email>"
153164
continue
154165
fi
155166
@@ -159,6 +170,11 @@ jobs:
159170
then
160171
echo "Commit $sha missing Signed-off-by"
161172
missing="true"
173+
174+
echo "Committer name: $committer_name"
175+
echo "Committer email: $committer_email"
176+
echo "github.actor: ${{ github.actor }}"
177+
echo "github.event.pusher.name: ${{ github.event.pusher.name }}"
162178
fi
163179
done < shas.txt
164180

0 commit comments

Comments
 (0)