fix(ci): Update existing flake.lock PR if it exists already #468
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.
Overview
If a
flake.lock
automated PR already exists and hasn't been merged by the time a new job runs to create a new PR, it updates the existing PR instead of trying to create a new PR and failing because the branch already exists.Type of change
Related Issue(s)
flake.lock
update job should update the existing PR if an unmerged one exists #467How To Test
Read the changed bash script and ensure it makes sense. You can also test out the logic locally on a test repo. The thinking in the first few lines (the first
if
block) is:flake.lock
(this is to ensure we can push new changes, e.g. a commit exists on remote that we don't have locally)nix flake update
, which now runs on the latest version of the file from the branchChangelog
Update
flake.lock
CI automation to update existing PR if there is one.