-
-
Notifications
You must be signed in to change notification settings - Fork 356
Skip saving cache for merge_group event #812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
f2dda73 to
4f93b7d
Compare
|
@eregon Would you mind take a look and see if this makes sense? In #805 we have a user complaining that |
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') { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's documented in https://docs.github.com/en/actions/reference/workflows-and-actions/variables
There was a problem hiding this comment.
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.
eregon
left a comment
There was a problem hiding this 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.
Note, I did not do
yarn updatein 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.