Conversation
|
The rendered spec preview for this PR is available as a single page at https://tc39.es/ecma262/pr/3824 and as multiple pages at https://tc39.es/ecma262/pr/3824/multipage . |
|
I wonder if publishing the generated PR as a build artifact could be used in place of the Per actions/upload-artifact#14 it only currently supports single files though, so it could be tricky to use. |
| with: | ||
| ref: gh-pages | ||
|
|
||
| - name: Delete PR preview directory |
There was a problem hiding this comment.
This would also need to be queued to prevent collisions with publishing as in #3821
|
AFAIK build artifacts cannot be viewed as webpages online, which is the purpose of the previews. |
That's supposedly the point of the change to artifacts from the blog post I linked to. |
|
Oh, neat. Yeah, that would work, ecmarkup is capable of inlining all the assets if we ask it to. Maybe for the future though. (Edit: oh, though, that would mean no multipage previews, which would be shame.) |
|
We'll also need to do a one-time culling after this lands. Do you have a script to do that? Also, I'd love (for someone else) to explore using artifacts as @rbuckton suggests and get away from this whole custom gh-pages thing ASAP. |
|
Claude has such a script, sure. I can send a PR removing the dead ones once this lands. said script#!/bin/bash
set -euo pipefail
cd "$(dirname "$BASH_SOURCE")"/..
REPO="${GITHUB_REPOSITORY:-tc39/ecma262}"
echo "Cloning gh-pages branch..."
rm -rf gh-pages-cleanup
git clone --depth 1 --branch gh-pages "https://github.com/${REPO}.git" gh-pages-cleanup
cd gh-pages-cleanup
if [ ! -d pr ]; then
echo "No pr/ directory found."
rm -rf ../gh-pages-cleanup
exit 0
fi
to_remove=()
for dir in pr/*/; do
pr_number="$(basename "$dir")"
if ! [[ "$pr_number" =~ ^[0-9]+$ ]]; then
continue
fi
state="$(gh pr view "$pr_number" --repo "$REPO" --json state --jq .state 2>/dev/null || echo "UNKNOWN")"
if [ "$state" != "OPEN" ]; then
echo "PR #$pr_number is $state — will remove"
to_remove+=("pr/$pr_number")
else
echo "PR #$pr_number is open — keeping"
fi
done
if [ ${#to_remove[@]} -eq 0 ]; then
echo "Nothing to clean up."
rm -rf ../gh-pages-cleanup
exit 0
fi
git config user.email "bot@tc39"
git config user.name "Bot"
git rm -rf "${to_remove[@]}"
git commit --message "Remove gh-pages previews for closed PRs"
echo ""
echo "Ready to push. Run:"
echo " cd gh-pages-cleanup && git push origin gh-pages && cd .. && rm -rf gh-pages-cleanup" |
Per https://matrixlogs.bakkot.com/TC39_Editors/2026-04-08#L22.
Claude wrote this but seems fine.