Skip to content

build-jupyter-cache/publish: pin siblings, scope artifact, harden release (#38) - #44

Merged
mmcky merged 2 commits into
mainfrom
fix/build-cache-publish-guards
Jun 16, 2026
Merged

mmcky merged 2 commits into
mainfrom
fix/build-cache-publish-guards

Conversation

@mmcky

@mmcky mmcky commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Closes #38 (H8, M14, M15, M16).

⚠️ H8 — corrected fix (relative paths → @v0)

The issue (and my original review) proposed switching build-jupyter-cache's sibling calls to relative ./ paths. That would have broken every consumer: inside a composite action, uses: ./setup-environment resolves against the consumer's $GITHUB_WORKSPACE, not this repo — a documented runner limitation (actions/runner#1348, #2101).

So instead I pinned the four internal calls from @main → @v0. This keeps the working full-path reference while fixing the actual risk (a pinned [email protected] no longer transitively runs unreleased main). It tracks the floating release tag, consistent with how consumers reference these actions.

M14 — artifact only on failure

build-jupyter-cache saved _build to the GHA cache and uploaded it as a 30-day artifact on every run (upload-artifact default true), duplicating ~150 MB. Now the artifact uploads only when a build fails — exactly when it's useful, since the cache isn't saved on failure. On success the cache is the single copy. (upload-artifact: false still suppresses it entirely.)

M15 — release tarball can't include itself

publish-gh-pages ran tar -czf "$ARCHIVE_NAME" -C build-dir . in the cwd, so if build-dir was the cwd/parent the growing archive could recurse into itself. The tarball, checksum, and manifest are now written to $RUNNER_TEMP (outside build-dir); the checksum still references just the archive filename.

M16 — guard create-release-assets

Previously no tag/token guard, so enabling it without a tag or token failed confusingly mid-upload. Now it:

  • skips cleanly off-tag (warning + assets-created=false);
  • fails fast if github-token is empty (checked via an env var, not inlined into the script);
  • gates the upload step on assets actually being created.

Verification

  • Both action YAMLs validated.
  • H8: 4 internal refs now @v0, no @main remaining.

Closes #38

🤖 Generated with Claude Code

…den release (#38)

- H8: build-jupyter-cache called siblings via @main, so a pinned
  build-jupyter-cache transitively ran unreleased main code. Pin them to @v0.
  NOTE: the issue proposed relative `./` paths, but in a composite action
  those resolve against the consumer's $GITHUB_WORKSPACE, not this repo
  (actions/runner#1348), so they'd break consumers — @v0 is the correct fix.
- M14: stop duplicating the cached _build into a 30-day artifact on every
  successful run. Upload the artifact only when a build fails (cache isn't
  saved then, so it's the sole debugging copy).
- M15: write the release tarball/checksum/manifest to $RUNNER_TEMP, outside
  build-dir, so the growing archive can't recurse into itself.
- M16: guard create-release-assets — skip cleanly off-tag, fail fast when
  github-token is empty (checked via env, not inlined), and gate the upload
  step on assets actually being created.

Closes #38

Co-Authored-By: Claude Opus 4.8 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens two composite actions (build-jupyter-cache and publish-gh-pages) to reduce supply-chain risk and unnecessary storage usage, and to make release-asset creation safer and more predictable.

Changes:

  • Pin build-jupyter-cache’s sibling action calls from @main to the floating release tag @v0.
  • Upload the _build artifact only when a build fails (keeping cache as the single copy on success).
  • Harden publish-gh-pages release asset creation: guard on tag + token, write assets to $RUNNER_TEMP, and gate upload on assets actually being created.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
build-jupyter-cache/action.yml Pins sibling uses: references to @v0 and scopes _build artifact upload to failure-only runs.
publish-gh-pages/action.yml Adds tag/token guards for release assets and writes tar/checksum/manifest outside build-dir; gates upload accordingly.
CHANGELOG.md Documents the pinning, artifact scoping, and release-asset hardening behavior changes.

Comment thread publish-gh-pages/action.yml Resolved
The 'Release assets uploaded' summary line still fired whenever
create-release-assets was true, but M16 made create-assets skip off-tag.
Gate the message on steps.create-assets.outputs.assets-created so it only
appears when assets were actually created and uploaded.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mmcky
mmcky merged commit c47cf9a into main Jun 16, 2026
@mmcky
mmcky deleted the fix/build-cache-publish-guards branch June 16, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build-jupyter-cache/publish-gh-pages: relative sibling paths + artifact/release guards

2 participants