@@ -196,7 +196,7 @@ run_step() {
196196 RUNNER_TEMP=" $WORK /rt" \
197197 GITHUB_OUTPUT=" $WORK /out.txt" \
198198 STUB_FIXTURES=" $PWD /tests/fixtures" \
199- PR_NUMBER=172 \
199+ PR_NUMBER=" ${PR_NUMBER- 172} " \
200200 REPO=hotdata-dev/dlthubworker \
201201 STUB_JOB_LOG=" ${STUB_JOB_LOG:- job-log-django.txt} " \
202202 GH_VERSION=" ${GH_VERSION:- 2.96} " \
@@ -557,6 +557,21 @@ reviews|prior reviews could not be read
557557comments|prior inline review comments could not be read
558558ENDPOINTS
559559
560+ # An empty PR_NUMBER is a real case, not a caller bug: tests.yml calls the workflow on
561+ # `push: branches: [main]`, where there is no pull request. The first guard in the script was
562+ # written `${PR_NUMBER:?}`, which fires on empty as well as unset, so the whole script exited on
563+ # line 26 of every main-push smoke run -- the run stayed green because the step is
564+ # continue-on-error, and the smoke test silently stopped covering anything past that line.
565+ # The reads are expected to degrade here; what matters is that the script gets to them.
566+ PR_NUMBER=' ' run_step " no pull request number" > " $WORK /code.txt"
567+ expect " $( cat " $WORK /code.txt" ) " " 0" " step exits 0 when there is no pull request number"
568+ if grep -q " must set PR_NUMBER" " $WORK /step.out" ; then
569+ echo " FAIL an empty PR_NUMBER aborts the script; a main-push smoke run covers nothing"
570+ failures=$(( failures + 1 ))
571+ else
572+ echo " ok an empty PR_NUMBER degrades the reads instead of aborting the script"
573+ fi
574+
560575if [ " $failures " -ne 0 ]; then
561576 echo " $failures test(s) failed"
562577 exit 1
0 commit comments