Skip to content

ci(automerge): decide from the PR's live labels and draft state - #45

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/automerge-live-labels
Oct 21, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
ci/automerge-live-labels

Conversation

@znerol2

@znerol2 znerol2 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

This brings the umbrella's automerge.yml from 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 opened run executed after the labeled run, it armed a PR that already carried hold. 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

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>
@znerol2
znerol2 requested a review from a team as a code owner October 21, 2026 13:37
@znerol2
znerol2 requested a review from lkirc October 21, 2026 13:37
@github-actions
github-actions Bot enabled auto-merge (rebase) October 21, 2026 13:37

@lkirc lkirc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review of 3290c4f: live metadata lookup fails closed and preserves hold/draft safeguards. Required checks are green; precise ntfy OK verified.

@github-actions
github-actions Bot merged commit fbcd74c into main Oct 21, 2026
11 checks passed
@znerol2
znerol2 deleted the ci/automerge-live-labels branch October 21, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants