Skip to content

Commit 77aaf46

Browse files
committed
ci: fix early exit
Not very nice, but at least it should not blow up. Signed-off-by: Marc Poulhiès <[email protected]>
1 parent 1a9f647 commit 77aaf46

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/send-emails.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,19 @@ jobs:
7575
echo "SERIES_DIR=/tmp/series" >> $GITHUB_ENV
7676
7777
- name: Check for label 'no-ml' to skip sending emails
78+
id: checklabel
7879
run: |
7980
# Skip if PR has label "no-ml"
8081
if echo "$PR_LABELS" | grep -qiE "(^|,)no-ml(,|$)"; then
8182
echo "Opt-out label present: skipping mailing list." | tee $GITHUB_STEP_SUMMARY
82-
exit 0
83+
echo "skip_sending=1" >> $GITHUB_OUTPUT
84+
else
85+
echo "skip_sending=0" >> $GITHUB_OUTPUT
8386
fi
8487
8588
- name: Get commit list from PR and skip the internal ones
8689
id: commits
90+
if: ${{ steps.checklabel.outputs.skip_sending != '1' }}
8791
run: |
8892
# Skip commits that touches any of these
8993
patterns=(".github/"
@@ -120,14 +124,16 @@ jobs:
120124
echo "COUNT=$COUNT" >> $GITHUB_ENV
121125
122126
- name: Check what to do based on series' size
127+
if: ${{ hashFiles('/tmp/commits') != '' }}
128+
id: checksize
123129
run: |
124130
MAX=150
125131
if [ "${COUNT}" -gt "$MAX" ]; then
126132
echo "Series has $COUNT commits (> $MAX). Not doing anything" | tee $GITHUB_STEP_SUMMARY
127-
exit 0
128133
fi
129134
130135
- name: Prepare patch series
136+
if: ${{ hashFiles('/tmp/commits') != '' }}
131137
run: |
132138
set -euo pipefail
133139
@@ -184,6 +190,7 @@ jobs:
184190
done < <(find /tmp/series/ -maxdepth 1 -type f -print0|sort -z -n)
185191
186192
- name: Send series via git send-email
193+
if: ${{ hashFiles('/tmp/commits') != '' }}
187194
env:
188195
GIT_SMTP_SERVER: ${{ secrets.SMTP_SERVER }}
189196
GIT_SMTP_ENCRYPTION: tls

0 commit comments

Comments
 (0)