Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/merge-bot-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ jobs:
{"head": "upstream-version-main", "base": "main"},
{"head": "upstream-version-develop", "base": "develop"}
]'
# The no-auto-merge- marker is reserved ahead of every rule, built-in or caller-supplied, so a caller's own head-prefix can never match an opted-out head.
Comment thread
ptr727 marked this conversation as resolved.
matched=$(jq -r --argjson extra "$RULES" --arg head "$HEAD_REF" --arg base "$BASE_REF" '
. + $extra
| map(select(.base == $base)
| select((.head // "") == $head or ((."head-prefix" // "") as $p | $p != "" and ($head | startswith($p)))))
| length > 0' <<<"$builtin")
if [[ "$matched" != "true" ]]; then
if $head | startswith("no-auto-merge-") then false else
. + $extra
| map(select(.base == $base)
| select((.head // "") == $head or ((."head-prefix" // "") as $p | $p != "" and ($head | startswith($p)))))
| length > 0
end' <<<"$builtin")
if [[ "$HEAD_REF" == no-auto-merge-* ]]; then
echo "::warning::App pull request $HEAD_REF -> $BASE_REF carries the no-auto-merge- marker, not auto-merging"
elif [[ "$matched" != "true" ]]; then
echo "::warning::App pull request $HEAD_REF -> $BASE_REF matches no merge rule, not auto-merging"
fi
echo "matched=$matched" >>"$GITHUB_OUTPUT"
Expand Down