-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Don't ever update GitHub Actions unless they are actually pinned #6743
Conversation
e49c779
to
ec1a9a8
Compare
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.
This makes sense to me. I've seen that come up in support a few times where Dependabot didn't update actions because of a stray reference to a branch in one workflow so this seems like an improvement. Do we have any test cases that cover mixed usage of branch/sha/version?
I guess we don't have tests for those cases, since they were not working up until now and tests were still passing. It'd be good to add those, but didn't want to delay the fix to this regression. Should I ship this, and then try add some more specs as a follow up? |
I was thinking about the kind of test case that we should add. For this case, given that this involves both file fetching and update checking, I think it's probably best to add a few smoke tests. |
There should be no update in this scenario: uses: dtolnay/rust-toolchain@master
# ...
uses: dtolnay/rust-toolchain@stable
# ...
uses: dtolnay/[email protected] The |
You mean that you'll never want any updates to a |
There should never be an update to a Updating a Ignoring this particular action is of course possible, but it would be a big pain. Large parts of the Rust ecosystem use |
That deviates from how Dependabot works for every other action, so I don't think we will be changing this behavior. In any case, it would be a separate feature request. Dependabot has been creating PRs updating |
Welp, looks like Dependabot and parts of |
The change in Dependency combine logic at #6082 surfaced a bug where if a Github Action is referencing two different branches in the same workflow, Dependabot would create a PR unifying it to a single branch, while is not what the user wants.
The fix is to ignore any
uses:
references which include a reference that should not be updated, like a branch name not named like a version (likemaster
orstable
).In addition to fixing this bug, this change also allows Dependabot to create PRs for mixed situations like the following, where the version is updated and the others are left alone:
or the following, where the SHA is updated and the others are left alone:
There's a change in behavior for other mixed cases like
Before Dependabot would find no updates, while now it will update both the SHA-pinned and the version-pinned lines to the latest version. I'm unclear about why users would pin some workflows and not others, so I'm fine with making this change and listen to any users that don't actually want this. My expectation is that this will help users catch situations where they were unintentionally using multiple styles and help them unify those.
Fixes #6739.