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
17 changes: 16 additions & 1 deletion .github/workflows/quarto-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v7
with:
fetch-depth: 0
# Shallow checkout (issue #306, B5): the change-detection step
# below needs only the base commit, which it fetches on demand.
# Full history costs ~1 min of checkout against a ~5 GB .git.
fetch-depth: 1

# ── Detect changed files ─────────────────────────────────
# Determines which QMDs changed so we can:
Expand All @@ -106,6 +109,18 @@ jobs:
exit 0
fi

# Shallow checkout (issue #306, B5): fetch just the base commit so
# the diff below has both endpoints. Fails soft – on error (e.g.
# the base commit was force-pushed away) fall back to a full build.
if ! git fetch --no-tags --depth=1 origin "$BASE_SHA"; then
echo "⚠️ Could not fetch base $BASE_SHA – treating as full build"
echo "changed_qmds=" >> "$GITHUB_OUTPUT"
echo "has_changes=false" >> "$GITHUB_OUTPUT"
echo "need_julia=true" >> "$GITHUB_OUTPUT"
echo "need_python=true" >> "$GITHUB_OUTPUT"
exit 0
fi

CHANGED_QMDS=$(git diff --name-only --diff-filter=ACMR "$BASE_SHA" HEAD -- '*.qmd' 2>/dev/null | tr '\n' ' ' || echo "")
echo "changed_qmds=$CHANGED_QMDS" >> "$GITHUB_OUTPUT"

Expand Down
Loading