fix(cost-map-sync): keep the reconcile step green when arming auto-merge fails

A failed `gh pr merge --auto` in the fallback arm aborted the step under
`set -e` before the warning and before `sync` was written, so every later
tick went red on the same PR. The failure now prints a warning naming the
PR for a human to merge and the tick carries on.
This commit is contained in:
mateo-berri 2026-09-05 00:47:33 -07:00
parent b2402f8abf
commit d3ff59fd8a

View file

@ -72,10 +72,10 @@ jobs:
SUCCESS,pass|SUCCESS,pass,skipping|SUCCESS,skipping)
if gh pr merge "$number" --repo "$GITHUB_REPOSITORY" --merge --delete-branch; then
echo "Merged sync PR #$number; the next scheduled run syncs from the merged registry."
elif [ "$(jq -r .autoMergeRequest <<< "$pr")" = "null" ] \
&& ! gh pr merge "$number" --repo "$GITHUB_REPOSITORY" --auto --merge --delete-branch; then
echo "::warning::Sync PR #$number is green but the app can neither merge it nor arm auto-merge on $GITHUB_REF_NAME; a human has to merge it."
else
if [ "$(jq -r .autoMergeRequest <<< "$pr")" = "null" ]; then
gh pr merge "$number" --repo "$GITHUB_REPOSITORY" --auto --merge --delete-branch
fi
echo "::warning::Sync PR #$number is green but the app is not a bypass actor on $GITHUB_REF_NAME; auto-merge is armed, so one approval lands it."
fi
;;