Fix github actions cooldown bypass for SHA-pinned refs#14667
Fix github actions cooldown bypass for SHA-pinned refs#14667albrektsson wants to merge 3 commits intodependabot:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a cooldown bypass in the github_actions ecosystem where SHA-pinned GitHub Actions could still propose a ref update even when the newest candidate was filtered out by release cooldown.
Changes:
- Update
UpdateChecker#updated_refto honor the cooldown-filteredlatest_versionresult before proposing an updated commit SHA. - Add a regression spec ensuring
can_update?is false when the latest commit falls within the cooldown window for SHA-pinned actions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| github_actions/lib/dependabot/github_actions/update_checker.rb | Ensures SHA ref updates are blocked when cooldown would keep the dependency at the pinned SHA. |
| github_actions/spec/dependabot/github_actions/update_checker_spec.rb | Adds regression coverage for the cooldown + SHA-pinned can_update? behavior. |
|
The bug we saw in a dependabot workflow: but then at the end of said job:
|
What are you trying to accomplish?
Fix a cooldown bypass for GitHub Actions dependencies pinned to commit SHAs that do not resolve to a semver version.
For SHA-pinned actions, cooldown could filter out the newest candidate while the ref update path still proposed a new commit. As a result, Dependabot could still treat the dependency as updateable even though it should have been held back by cooldown.
This change makes
updated_refhonor the cooldown-filtered result before proposing a new ref.Anything you want to highlight for special attention from reviewers?
The fix is placed in
updated_ref, since that is the method responsible for deciding whether a ref update should be proposed.How will you know you've accomplished your goal?
I added a regression spec,
does not suggest an update when the latest commit is within the cooldown window, covering a SHA-pinned GitHub Action with cooldown enabled. The test fails without the fix and passes with it.I also ran the full
github_actionstest suite:bundle exec rspecChecklist