ci: Consistenly only cache on the default branch #33905

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2511-ci-cache-branch changing 1 files +2 −2
  1. maflcko commented at 6:23 pm on November 18, 2025: member

    Fixes #33685

    The general idea for caches is to only save them on pushes to the default branch, because the cache is limited in size and time that the only benefit of the cache can be to speed up pull requests against the default branch.

    Backport pull requests to older branches don’t benefit from caches, because usually they will be running into a cache miss anyway. Also, they would cause the cache size to overflow and lead to cache misses down the line.

    So fix it by consistently applying cache saves only on the default branch.

    For reference, the same is already done for the composite action in this repo: https://github.com/bitcoin/bitcoin/blob/2444488f6ad32dcbbed51a73cd4f59ff3a239e32/.github/actions/save-caches/action.yml#L15

  2. ci: Consistenly only cache on the default branch fa411f938e
  3. DrahtBot added the label Tests on Nov 18, 2025
  4. DrahtBot commented at 6:23 pm on November 18, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33905.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hebasto, willcl-ark

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. hebasto approved
  6. hebasto commented at 9:40 pm on November 18, 2025: member
    ACK fa411f938e4796cf3806f234c9787b7c79492cc2.
  7. fanquake commented at 9:33 am on November 19, 2025: member
  8. willcl-ark approved
  9. willcl-ark commented at 9:40 am on November 19, 2025: member

    ACK fa411f938e4796cf3806f234c9787b7c79492cc2

    We could probably drop github.event_name != 'pull_request' &&? Feels like it might be redundant with github.ref_name == github.event.repository.default_branch

  10. maflcko commented at 10:00 am on November 19, 2025: member

    Yeah, I guess even if a pull is opened from a branched named equally to the default branch, the ref_name is rewritten to <pr_number>/merge, according to https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context

    However, it can’t hurt to check twice explicitly, so I’ll leave as-is for now :sweat_smile:

  11. fanquake merged this on Nov 20, 2025
  12. fanquake closed this on Nov 20, 2025

  13. maflcko deleted the branch on Nov 20, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-01 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me