Skip to content

Skip restore on default-branch builds by default#34

Merged
joshfriend merged 1 commit into
mainfrom
auto-skip-restore-default-branch
Jun 22, 2026
Merged

Skip restore on default-branch builds by default#34
joshfriend merged 1 commit into
mainfrom
auto-skip-restore-default-branch

Conversation

@joshfriend

@joshfriend joshfriend commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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.

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.
@joshfriend joshfriend force-pushed the auto-skip-restore-default-branch branch from f6ea2dd to 707821b Compare June 18, 2026 21:06
@joshfriend joshfriend marked this pull request as ready for review June 22, 2026 16:43
@joshfriend joshfriend merged commit b2218f7 into main Jun 22, 2026
10 checks passed
@joshfriend joshfriend deleted the auto-skip-restore-default-branch branch June 22, 2026 16:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread action/src/main.js
Comment on lines +21 to +25
if (isDefaultBranchBuild()) {
core.info(
"Cache restore skipped — default-branch build publishes a fresh base bundle",
);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant