From e53cbf79c51a96c68ead75a3427e3b79b64ee94c Mon Sep 17 00:00:00 2001 From: Atharva0506 Date: Fri, 4 Sep 2026 22:48:09 +0530 Subject: [PATCH] ci(preview): stop hiding the base marker from its own artifact actions/upload-artifact leaves hidden files out of the artifact unless told otherwise, so dist/.preview-base never reached the publish job: the artifact built for #211 has 231 entries and not one dot-prefixed among them. The base check would then have read nothing, called it '', and refused every preview. Renamed rather than switched on include-hidden-files, so it does not depend on that input existing at the pinned action version. --- .github/workflows/pr-build.yml | 6 ++++-- .github/workflows/pr-deploy.yml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 06098528..d4abcf2d 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -85,8 +85,10 @@ jobs: npm run build -- --mode preview --base "$base" # Recorded so the publish job can refuse a build made for the wrong - # path, instead of publishing a page that loads nothing. - printf '%s' "$base" > dist/.preview-base + # path, instead of publishing a page that loads nothing. Not a + # dotfile: actions/upload-artifact leaves hidden files out of the + # artifact by default, and this has to survive the trip. + printf '%s' "$base" > dist/preview-base # A CNAME means something only at the site root, and the root belongs # to the production deploy. diff --git a/.github/workflows/pr-deploy.yml b/.github/workflows/pr-deploy.yml index f25c7d77..70a7cd96 100644 --- a/.github/workflows/pr-deploy.yml +++ b/.github/workflows/pr-deploy.yml @@ -178,13 +178,13 @@ jobs: # blank, which is worth an error rather than a puzzled contributor. # Stripped of anything but path characters before being echoed, since # the file came from the build. - built_base="$(tr -dc 'A-Za-z0-9/._-' < preview/.preview-base 2>/dev/null || true)" + built_base="$(tr -dc 'A-Za-z0-9/._-' < preview/preview-base 2>/dev/null || true)" if [ "$built_base" != "$EXPECTED_BASE" ]; then echo "::error::this build is for '${built_base:-}' but the site serves '${EXPECTED_BASE}'." echo "::error::set PREVIEW_PUBLIC_BASE=${{ needs.resolve.outputs.base_path }} in frontend/.env.preview" exit 1 fi - rm -f preview/.preview-base + rm -f preview/preview-base - name: Publish to gh-pages env: