Merge pull request #724 from PicPeak/fix/release-automerge-pat
fix: enable release-PR auto-merge with the PAT so releases actually publish
This commit is contained in:
@@ -51,8 +51,14 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
pr=$(gh pr list --head release-please--branches--main --state open --json number --jq '.[0].number // empty')
|
pr=$(gh pr list --head release-please--branches--main --state open --json number --jq '.[0].number // empty')
|
||||||
if [ -n "$pr" ]; then
|
if [ -n "$pr" ]; then
|
||||||
|
# Approve as github-actions[bot] (GITHUB_TOKEN) — a different identity
|
||||||
|
# than the PR author (the PAT) — so it counts as a valid review.
|
||||||
gh pr review "$pr" --approve --body "Automated approval — release-please version bump + changelog (#719)." || true
|
gh pr review "$pr" --approve --body "Automated approval — release-please version bump + changelog (#719)." || true
|
||||||
gh pr merge "$pr" --squash --auto || true
|
# Enable auto-merge as the PAT so the eventual merge commit is
|
||||||
|
# attributed to a real identity. If enabled via GITHUB_TOKEN the merge
|
||||||
|
# push is suppressed by recursion prevention and the follow-up run that
|
||||||
|
# cuts the tag/release never fires (#719).
|
||||||
|
GH_TOKEN="$RELEASE_PAT" gh pr merge "$pr" --squash --auto || true
|
||||||
else
|
else
|
||||||
echo "No open release PR to auto-merge."
|
echo "No open release PR to auto-merge."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -44,8 +44,11 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
pr=$(gh pr list --head release-please--branches--stable --state open --json number --jq '.[0].number // empty')
|
pr=$(gh pr list --head release-please--branches--stable --state open --json number --jq '.[0].number // empty')
|
||||||
if [ -n "$pr" ]; then
|
if [ -n "$pr" ]; then
|
||||||
|
# Approve as github-actions[bot] (GITHUB_TOKEN, ≠ the PAT author) so it
|
||||||
|
# is a valid review; enable auto-merge as the PAT so the merge commit is
|
||||||
|
# attributed to a real identity and triggers the tag-cutting run (#719).
|
||||||
gh pr review "$pr" --approve --body "Automated approval — release-please version bump + changelog (#719)." || true
|
gh pr review "$pr" --approve --body "Automated approval — release-please version bump + changelog (#719)." || true
|
||||||
gh pr merge "$pr" --squash --auto || true
|
GH_TOKEN="$RELEASE_PAT" gh pr merge "$pr" --squash --auto || true
|
||||||
else
|
else
|
||||||
echo "No open release PR to auto-merge."
|
echo "No open release PR to auto-merge."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user