From ad981214ef608206094b0f5c121fa5660693149b Mon Sep 17 00:00:00 2001 From: tamnd <1218621+tamnd@users.noreply.github.com> Date: Sat, 31 Oct 2026 18:09:02 +0700 Subject: [PATCH 1/2] Add the full catalogue of tamnd/math2-records to the site build --- .github/workflows/pages.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index df0df7645f4..38a32e601ad 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -46,6 +46,23 @@ jobs: - name: build m2 working-directory: toolchain run: go build -trimpath -o "$RUNNER_TEMP/m2" ./cmd/m2 + # The full catalogue of resources is in tamnd/math2-records at the commit of manifests/records.yaml (RS12.3). The site needs each resource, not only the tiers that math2 keeps. + - name: read the pin of the records + id: pin + run: | + if [ -f content/manifests/records.yaml ]; then + echo "commit=$(sed -n 's/^commit: //p' content/manifests/records.yaml)" >> "$GITHUB_OUTPUT" + fi + - if: steps.pin.outputs.commit != '' + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + repository: tamnd/math2-records + ref: ${{ steps.pin.outputs.commit }} + path: records + - name: add the full catalogue + if: steps.pin.outputs.commit != '' + run: '"$RUNNER_TEMP/m2" res records unpack -root content -out records' - name: build the site env: COMMIT: ${{ github.sha }} From dca24d3723a0fc330de4a4ec25c89818e0051619 Mon Sep 17 00:00:00 2001 From: tamnd <1218621+tamnd@users.noreply.github.com> Date: Sat, 31 Oct 2026 18:14:51 +0700 Subject: [PATCH 2/2] Fetch the pinned records with git, not with a checkout from a step output --- .github/workflows/pages.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 38a32e601ad..cd85ade4e55 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -47,22 +47,21 @@ jobs: working-directory: toolchain run: go build -trimpath -o "$RUNNER_TEMP/m2" ./cmd/m2 # The full catalogue of resources is in tamnd/math2-records at the commit of manifests/records.yaml (RS12.3). The site needs each resource, not only the tiers that math2 keeps. - - name: read the pin of the records - id: pin + - name: add the full catalogue run: | - if [ -f content/manifests/records.yaml ]; then - echo "commit=$(sed -n 's/^commit: //p' content/manifests/records.yaml)" >> "$GITHUB_OUTPUT" + commit=$(sed -n 's/^commit: //p' content/manifests/records.yaml 2>/dev/null || true) + if [ -z "$commit" ]; then + echo "no pin of the records" + exit 0 fi - - if: steps.pin.outputs.commit != '' - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - repository: tamnd/math2-records - ref: ${{ steps.pin.outputs.commit }} - path: records - - name: add the full catalogue - if: steps.pin.outputs.commit != '' - run: '"$RUNNER_TEMP/m2" res records unpack -root content -out records' + if ! printf '%s' "$commit" | grep -Eq '^[0-9a-f]{40}$'; then + echo "the pin of the records is not a commit: $commit" + exit 1 + fi + git init -q records + git -C records fetch -q --depth 1 https://github.com/tamnd/math2-records "$commit" + git -C records checkout -q FETCH_HEAD + "$RUNNER_TEMP/m2" res records unpack -root content -out records - name: build the site env: COMMIT: ${{ github.sha }}