Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/actions/prose-gate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,19 @@ runs:
# Check the base resolves before scanning, so an empty or absent ref fails naming itself.
# Unresolvable, the run would report the repository's whole backlog against this change.
# A shallow checkout is the usual cause, so the caller fetches full history.
if ! git rev-parse --verify --quiet "$BASE^{commit}" >/dev/null; then
# A base that is a freshly created merge commit can still lag GitHub's own replication, so retry with backoff before failing rather than treat that lag as a gate failure.
resolved=false
for delay in 0 2 4 8 15 30; do
if [ "$delay" -gt 0 ]; then
sleep "$delay"
git fetch --quiet origin "$BASE" 2>/dev/null || true
fi
if git rev-parse --verify --quiet "$BASE^{commit}" >/dev/null; then
resolved=true
break
fi
done
if ! "$resolved"; then
echo "::error::Diff base '$BASE' does not resolve in this checkout." >&2
echo "::error::Check the ref name and that the job checks out with fetch-depth 0." >&2
exit 1
Expand Down