You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: let the ruleset decide whether the merge is unattended
The approval gate added in b1670c3 was the wrong shape. It read reviewDecision and
refused unless APPROVED, which is correct only while main's ruleset lists no bypass
actors — the moment this workflow's identity becomes one, the gate would keep
refusing merges the ruleset would have allowed, and the fix would be to remember to
delete it.
The merge is now attempted unconditionally and the outcome classified, so one script
is right in both worlds: unattended where a bypass actor exists, and
"blocked awaiting a code-owner approval (@aws/aws-lambda-tooling), or a ruleset
bypass actor for this workflow" where none does. Nothing to keep in sync with a
repository setting the script cannot see.
BLOCKED is still separated from DIRTY/BEHIND/DRAFT/UNKNOWN, and now splits by
reviewDecision so the three cases read differently: awaiting approval, approved but
some other rule unsatisfied, and changes requested. It is no longer reported as
"a sibling update landed first", which was never true for it.
Seven paths exercised: unapproved without bypass, approved without bypass, unapproved
with bypass, approved-but-blocked, changes-requested, a sibling conflict, and an
unexplained failure still exiting 1.
echo"PR #$PR is example-only and verified at $head_sha by run $run_id (reviewDecision=$review). Merging."
189
176
190
177
# --match-head-commit closes the remaining window: if the branch moves between the
191
178
# lookups above and this call, the API rejects the merge rather than applying it to an
@@ -221,7 +208,21 @@ case "$state" in
221
208
# reported as "a sibling update landed first", which was simply the wrong diagnosis:
222
209
# main's ruleset blocks a merge until the required review is satisfied.
223
210
BLOCKED)
224
-
skip "merge rejected, blocked by main's ruleset (review or a required check) — reviewDecision was $review."
211
+
# main's ruleset requires one code-owner approval (.github/CODEOWNERS assigns `*` to
212
+
# @aws/aws-lambda-tooling) and lists no bypass actors, so this is the expected
213
+
# outcome until either a human approves or this workflow's identity is made a bypass
214
+
# actor. Named precisely, because it used to be reported as a sibling conflict.
215
+
case"$review"in
216
+
APPROVED)
217
+
skip "merge rejected, blocked by main's ruleset even though it is approved — a required rule is unsatisfied."
218
+
;;
219
+
CHANGES_REQUESTED)
220
+
skip "merge rejected, a reviewer requested changes."
221
+
;;
222
+
*)
223
+
skip "verified at ${head_sha:0:8} by run $run_id — blocked awaiting a code-owner approval (@aws/aws-lambda-tooling), or a ruleset bypass actor for this workflow."
224
+
;;
225
+
esac
225
226
;;
226
227
DIRTY | BEHIND | DRAFT | UNKNOWN)
227
228
skip "merge rejected, not mergeable (mergeStateStatus=$state) — most likely a sibling update landed first."
0 commit comments