Skip to content

ci: add workflow to cleanup per-PR Actions caches on close#1156

Open
mr-raj12 wants to merge 1 commit intoasyncapi:masterfrom
mr-raj12:ci/cleanup-pr-caches-workflow
Open

ci: add workflow to cleanup per-PR Actions caches on close#1156
mr-raj12 wants to merge 1 commit intoasyncapi:masterfrom
mr-raj12:ci/cleanup-pr-caches-workflow

Conversation

@mr-raj12
Copy link
Copy Markdown

Adds .github/workflows/cleanup-pr-caches.yml. The workflow runs on pull_request.closed and deletes every GitHub Actions cache scoped to the closing PR's ref (refs/pull/<n>/merge) via actions/github-script.

Without this, per-PR caches linger under the 10 GB repository cache quota until GitHub's 7-day LRU eviction kicks in, and caches for master and open PRs can be evicted ahead of them. This workflow keeps the quota available for the branches that matter.

  • New file, so it is outside the scope of the central asyncapi/.github workflow sync.
  • Runs only on PR close — no impact on existing CI jobs.
  • Scoped permissions: actions: write, contents: read.

Resolves #1155

Adds .github/workflows/cleanup-pr-caches.yml that runs on
pull_request.closed and deletes every GitHub Actions cache scoped
to the closing PR's ref, so the 10 GB repository cache quota stays
available for master and open PRs.

Fixes asyncapi#1155
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

⚠️ No Changeset found

Latest commit: c6ab8c5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sonarqubecloud
Copy link
Copy Markdown

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.

[FEATURE] Add workflow to cleanup per-PR GitHub Actions caches on close

1 participant