Skip to content

Conversation

@ntkme
Copy link
Contributor

@ntkme ntkme commented Sep 30, 2025

Note, I did not do yarn update in order to keep the lockfile change small. This has introduced some transitive dependencies at different versions. One of the maintainers should probably do a dependency update at some point.

@ntkme ntkme force-pushed the merge-group branch 3 times, most recently from f2dda73 to 4f93b7d Compare October 8, 2025 16:42
@ntkme
Copy link
Contributor Author

ntkme commented Dec 20, 2025

@eregon Would you mind take a look and see if this makes sense?

In #805 we have a user complaining that merge_group (merge queue) events are saving cache, but those cache will never have any chance to be read again. In a large repository, this can consume lots of cache space on GitHub to the point it is purging older cache aggressively, and significantly reduce overall cache hit rate.

bundler.js Outdated
// @actions/cache only allows to save for non-existing keys
if (!common.isExactCacheKeyMatch(key, cachedKey)) {
// Also, skip saving cache for merge_group event
if (!common.isExactCacheKeyMatch(key, cachedKey) && github.context.eventName !== 'merge_group') {
Copy link
Member

Choose a reason for hiding this comment

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

How about reading from $GITHUB_EVENT_NAME? That would avoid 4k lines and many packages in dist/index.js just for this check

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@ntkme ntkme Dec 20, 2025

Choose a reason for hiding this comment

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

Good idea. I didn't thought about that. One small concern is that github.context.eventName is immutable, but $GITHUB_EVENT_NAME is mutable. At least in here there is no point to abuse this difference, so it's not a problem.

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Thanks, looks good but let's use the env var to avoid pulling a bunch of dependencies we don't need.

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.

Provide ability to restore from cache but NOT save cache

2 participants