allow updating at a commit, for testing #5843
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
We can use Dependabot CLI to test specific commits of a repository with an input file like this:
This is useful in smoke testing so there's no fear of breaking all of the tests when making a new commit to the repo, the tests are essentially pinned. This is also useful for testing customer issues since the customer may have made new commits that changed the situation since the job ran.
Problem
Ecosystems that use the clone method to fetch code are not honoring the commit since they only call clone with a branch, or use the default branch. That makes it impossible to test arbitrary commits in Go, Github Actions, Pub, Terraform, and Yarn Berry.
Solution
I've added additional calls to checkout the correct branch. This is low risk since it's guarded by a check to
source.commit
which should never be set in production. Production Dependabot is always interested in running against the latest commit in a branch.