Skip to content

Commit df21dba

Browse files
ci(pages): replace upload-pages-artifact composite with explicit SHA-pinned upload (#38)
ci(pages): replace upload-pages-artifact composite with explicit SHA-pinned upload `GitHub Pages` (casket-pages.yml) failed the org "all actions pinned to a full-length commit SHA" ruleset with: actions/upload-artifact@v4 is not allowed … must be pinned to a full-length commit SHA casket-pages.yml itself already pins every action. The violation is *transitive*: `actions/upload-pages-artifact@v3` is a composite action whose own action.yml does `uses: actions/upload-artifact@v4` (an unpinned upstream moving tag) — and the ruleset evaluates nested actions recursively, which we cannot pin from our side. Fix: drop the composite and do exactly what it does, with a SHA-pinned primitive — tar `_site` the way `actions/deploy-pages` expects and upload it as the `github-pages` artifact via `actions/upload-artifact@ea165f8d… # v4` (the same SHA already pinned elsewhere in this repo). `configure-pages` / `deploy-pages` stay (already pinned; they don't nest an unpinned upload-artifact). No behaviour change to the published site; removes the only remaining policy-blocked red. Pre-existing infra, unrelated to the #122/#30 source migration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0086584 commit df21dba

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/casket-pages.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,29 @@ jobs:
9999
- name: Setup Pages
100100
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
101101

102+
# NOTE: actions/upload-pages-artifact is a composite that internally
103+
# calls actions/upload-artifact@v4 (an UNPINNED upstream tag). The
104+
# org ruleset enforces "all actions pinned to a full-length SHA"
105+
# recursively, so the nested unpinned tag fails the check even
106+
# though our workflow pins everything. Replicate the composite's
107+
# behaviour explicitly with a SHA-pinned actions/upload-artifact
108+
# (same SHA already used elsewhere in this repo): tar the site as
109+
# deploy-pages expects (artifact name `github-pages`).
110+
- name: Archive site as the github-pages artifact
111+
run: |
112+
tar \
113+
--dereference --hard-dereference \
114+
--directory _site \
115+
-cvf "${RUNNER_TEMP}/artifact.tar" \
116+
--exclude=.git --exclude=.github \
117+
.
102118
- name: Upload artifact
103-
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
119+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
104120
with:
105-
path: '_site'
121+
name: github-pages
122+
path: ${{ runner.temp }}/artifact.tar
123+
retention-days: 1
124+
if-no-files-found: error
106125

107126
deploy:
108127
environment:

0 commit comments

Comments
 (0)