@@ -59,11 +59,11 @@ jobs:
5959 id : range
6060 run : |
6161 set -euo pipefail
62-
62+
6363 # Use GitHub-provided SHAs to build the range for this push
6464 BEFORE="${{ github.event.before }}"
6565 AFTER="${{ github.sha }}"
66-
66+
6767 if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]
6868 then
6969 # New branch or force push without previous SHA
@@ -76,34 +76,42 @@ jobs:
7676 run : |
7777 set -euo pipefail
7878 missing=""
79-
79+
8080 while read -r sha
8181 do
8282 [ -n "$sha" ] || continue
83-
83+
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
91-
94+
9295 msg=`git log --format=%B -n 1 "$sha"`
93-
96+
9497 if ! printf '%s' "$msg" | grep -Eqi '^[[:space:]]*Signed[- ]off[- ]by:'
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
100-
108+
101109 if [ "$missing" = "true" ]
102110 then
103111 echo "DCO check failed on push"
104112 exit 1
105113 fi
106-
114+
107115 echo "All pushed commits are signed"
108116
109117 CheckSignedOffPullRequest :
@@ -130,7 +138,7 @@ jobs:
130138 set -euo pipefail
131139 gh --version
132140 jq --version
133-
141+
134142 # Fetch all commits of the PR with pagination and extract SHAs
135143 gh api -H "Accept: application/vnd.github+json" --paginate \
136144 repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits \
@@ -144,21 +152,29 @@ jobs:
144152 while read -r sha
145153 do
146154 [ -n "$sha" ] || continue
147-
155+
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
155-
166+
156167 msg=`git log --format=%B -n 1 "$sha"`
157-
168+
158169 if ! printf '%s' "$msg" | grep -Eqi '^[[:space:]]*Signed[- ]off[- ]by:'
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
@@ -167,4 +183,4 @@ jobs:
167183 echo "DCO check failed"; exit 1
168184 fi
169185
170- echo "All commits are signed"
186+ echo "All commits are signed"
0 commit comments