Skip restore on default-branch builds by default#34
Conversation
Default-branch (e.g. main) pushes never restore. They publish a fresh full base bundle, which keeps it from growing without bound. Branches and PRs restore the base and publish a delta. Opinionated, no setting to override.
f6ea2dd to
707821b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 707821b430
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (isDefaultBranchBuild()) { | ||
| core.info( | ||
| "Cache restore skipped — default-branch build publishes a fresh base bundle", | ||
| ); | ||
| return; |
There was a problem hiding this comment.
Force full save on default branch despite branch input
When a workflow sets branch explicitly for all runs (for example ${{ github.ref_name }} to enable deltas on direct branch pushes), this early return skips restore on the default branch but the post step still sees the explicit branch and takes the save-delta path. Because no restore marker was created, action/src/post.js logs No restore marker found and returns, so default-branch runs publish no fresh base bundle at all instead of the intended full save.
Useful? React with 👍 / 👎.
Default-branch (e.g.
main) pushes never restore. They publish a fresh full base bundle, which keeps it from growing without bound. Branches and PRs restore the base and publish a delta.