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
12 changes: 10 additions & 2 deletions scripts/check_emdash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ else
fi

if [[ -z "$base" ]]; then
echo "WARNING: no base ref found, scanning all tracked files."
scan_all_files
# No base ref is available outside of pull requests, for
# example push builds on release branches with a shallow
# clone where neither GITHUB_BASE_REF nor origin/main is
# present. The diff check has nothing to compare against,
# and scanning every tracked file would flag pre-existing
# characters that are unrelated to the change under test.
# Skip instead; pass --all to force a full-tree scan.
echo "OK: no base ref found (not a pull request); skipping emdash check."
echo " Pass --all to scan every tracked file."
exit 0
else
# Ensure the base ref is fetchable. CI shallow clones
# (fetch-depth: 1) may not have the base branch available.
Expand Down
Loading