From d5a29b7c94828f9cc844bee50639030769eb485a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3zsa=20Zolt=C3=A1n?= <67325669+rozsazoltan@users.noreply.github.com> Date: Tue, 28 Jul 2026 16:13:43 +0200 Subject: [PATCH] fix(release): merge release commits through PRs --- .github/workflows/release.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ea5977..b9b0a07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,7 @@ on: permissions: contents: write + pull-requests: write concurrency: group: release-${{ inputs.version }} @@ -118,11 +119,17 @@ jobs: git add metadata.lua git -c commit.gpgSign=false commit -m "chore(release): ${tag}" - git switch "${DEFAULT_BRANCH}" - git merge --squash "${branch}" - git -c commit.gpgSign=false commit -m "chore(release): ${tag}" - git push origin "HEAD:refs/heads/${DEFAULT_BRANCH}" - git branch -D "${branch}" + git push --set-upstream origin "${branch}" + + export GH_TOKEN="${RELEASE_TOKEN}" + pr_url="$(gh pr create --base "${DEFAULT_BRANCH}" --head "${branch}" --title "chore(release): ${tag}" --body "Automated release preparation for ${tag}.")" + pr_number="$(gh pr view "${pr_url}" --json number --jq .number)" + + gh api --method PUT "repos/${GITHUB_REPOSITORY}/pulls/${pr_number}/merge" -f commit_title="chore(release): ${tag}" -f merge_method=squash + + git fetch origin "${DEFAULT_BRANCH}" --force + git switch -C "${DEFAULT_BRANCH}" "origin/${DEFAULT_BRANCH}" + git push origin --delete "${branch}" sha="$(git rev-parse HEAD)" echo "sha=${sha}" >> "${GITHUB_OUTPUT}"