Skip to content

Commit e57392c

Browse files
committed
fixup! add ci prettier changed-file check
1 parent 344120f commit e57392c

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

scripts/format-changed.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# Run Prettier only on files changed against a base ref/commit
54
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
65
cd "$ROOT_DIR"
76

8-
# Inputs that can be provided by CI
97
BASE_SHA="${BASE_SHA:-}"
108
BASE_REF="${BASE_REF:-${GITHUB_BASE_REF:-}}"
119
DEFAULT_BASE="${DEFAULT_BASE:-origin/main}"
@@ -18,12 +16,10 @@ else
1816
DIFF_BASE="$DEFAULT_BASE"
1917
fi
2018

21-
# Ensure the base ref exists locally
2219
if ! git rev-parse --verify "${DIFF_BASE}^{commit}" >/dev/null 2>&1; then
2320
git fetch --no-tags --prune --depth=1 origin "${DIFF_BASE#origin/}" >/dev/null 2>&1 || true
2421
fi
2522

26-
# If still missing, bail out gracefully to avoid blocking CI
2723
if ! git rev-parse --verify "${DIFF_BASE}^{commit}" >/dev/null 2>&1; then
2824
echo "Base ref ${DIFF_BASE} not found; skipping Prettier check." >&2
2925
exit 0

0 commit comments

Comments
 (0)