Skip to content

Commit 80ec4ee

Browse files
committed
fix(ci): fail the IndexNow step when the oldest run's parent cannot be resolved
1 parent 41239f2 commit 80ec4ee

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,8 @@ jobs:
672672
# changed URLs for good. The check-runs lookup asks for this one check per commit, so it
673673
# stays small and counts every attempt of a re-run; a lookup that errors counts as no
674674
# success. With no success in view, the base is the first parent of the oldest run in view,
675-
# so URLs that no submission ever covered, that run's own included, are sent now. The diff
675+
# so URLs that no submission ever covered, that run's own included, are sent now; a failed
676+
# parent lookup fails the step, so the next run retries from the same base. The diff
676677
# needs only the two trees, so that one commit is fetched alone; an all-zero `before` (the
677678
# branch's first push) has no base, which the script skips.
678679
- name: Submit changed URLs to IndexNow
@@ -692,9 +693,7 @@ jobs:
692693
done < <(gh api "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs?branch=main&event=push&per_page=30" \
693694
--jq ".workflow_runs[] | select(.id < $GITHUB_RUN_ID) | .head_sha")
694695
if [[ -z "$BASE_SHA" && -n "$OLDEST_SHA" ]]; then
695-
if ! BASE_SHA="$(gh api "repos/$GITHUB_REPOSITORY/commits/$OLDEST_SHA" --jq '.parents[0].sha // empty')"; then
696-
BASE_SHA="$OLDEST_SHA"
697-
fi
696+
BASE_SHA="$(gh api "repos/$GITHUB_REPOSITORY/commits/$OLDEST_SHA" --jq '.parents[0].sha // empty')"
698697
fi
699698
BASE_SHA="${BASE_SHA:-$PUSH_BEFORE}"
700699
echo "Submitting URLs changed in $BASE_SHA..$GITHUB_SHA"

0 commit comments

Comments
 (0)