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
22 changes: 15 additions & 7 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,24 @@ jobs:
with:
fetch-depth: 0

- name: Check if submission data changed
- name: Check if the preview needs rebuilding
id: check_changes
run: |
# Check if .uplc or metadata.json files changed compared to main
if git diff --name-only origin/main...HEAD | grep -qE 'submissions/.*\.(uplc|metadata\.json)$'; then
echo "Submission data files changed, proceeding with report generation"
echo "has_changes=true" >> $GITHUB_OUTPUT
# Deploy a preview when either the report inputs (submission data) or
# the report pipeline itself (generator, aggregate, templates) change.
# A pipeline-only PR produces no submission diff but can still change
# every rendered page, so it must be previewable too.
# Fetch the base ref first: fetch-depth:0 does not guarantee a local
# origin/main, so the diff below would otherwise hit an ambiguous
# revision (same reason the `changed` job fetches it explicitly).
git fetch origin main --depth=1
if git diff --name-only origin/main...HEAD | grep -qE \
'submissions/.*(\.uplc|/metadata\.json)$|scripts/cape-subcommands/submission/(report|aggregate)\.sh$|scripts/cape-subcommands/submission/.*\.html\.tmpl$'; then
echo "Report inputs or pipeline changed, proceeding with report generation"
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "No submission data changes detected (only docs/README), skipping deployment"
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No report-affecting changes detected, skipping preview deployment"
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi

- name: Install Nix
Expand Down