Repository navigation
ci(automerge): decide from the PR's live labels and draft state - #45
Merged
Merged
Conversation
The workflow read the hold label and the draft flag from the event payload. The payload can be stale: a label added or a draft toggled after the event fired was not seen, so a held or draft PR could still get auto-merge armed. A failed or malformed read also did not stop the run. The workflow now reads the PR's labels and draft state live when it runs, and fails closed if the read errors or returns a reply it cannot parse. This is the same file as the umbrella workflow, copied byte-identical. The regression test lives in the umbrella (tests/automerge-live-state.sh) and runs against this exact file. Refs dmfdeploy/dmfdeploy#439 Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This brings the umbrella's
automerge.ymlfrom dmfdeploy/dmfdeploy#659 to this repo, byte for byte.The old workflow decided from the labels and draft state in the event payload. That's a snapshot from when the event fired. If the
openedrun executed after thelabeledrun, it armed a PR that already carriedhold. The new workflow reads the PR's live labels and draft state through the API before it arms or disarms. It exits non-zero without touching auto-merge if that read fails or returns an unexpected shape.The file's git blob is
5328041e7b5f62e6a88a9714cbad20bc7103aadc, the same as the umbrella's. The umbrella's regression test,tests/automerge-live-state.sh, passes 8 of 8 cases against it. An adversarial review passed it on the umbrella before it merged.Refs dmfdeploy/dmfdeploy#439