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
25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,16 @@ jobs:
exit 1
fi
git commit -m "chore: bump manifest to ${VERSION} for ${TAG}"
git push -u origin "$BRANCH"

# Re-runs reuse branch name release/v*; a plain push fails non-fast-forward if the
# branch already exists with different history. Force-with-lease updates only when
# the remote ref still matches what we fetched (safer than bare --force).
git fetch origin "refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}" 2>/dev/null || true
if git rev-parse "refs/remotes/origin/${BRANCH}" >/dev/null 2>&1; then
git push -u origin "$BRANCH" --force-with-lease="refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}"
else
git push -u origin "$BRANCH"
fi

git fetch origin --tags
HEAD_SHA=$(git rev-parse HEAD)
Expand All @@ -128,11 +137,15 @@ jobs:
gh release create "$TAG" --target "$BRANCH" --title "$TAG" --generate-notes "${EXTRA[@]}"
fi

gh pr create \
--base "$DEFAULT_BRANCH" \
--head "$BRANCH" \
--title "Merge ${TAG} manifest bump" \
--body "Automated manifest bump for [${TAG}](https://github.com/${{ github.repository }}/releases/tag/${TAG}). Merge after checks pass so \`${DEFAULT_BRANCH}\` matches the release."
if [ "$(gh pr list --head "$BRANCH" --state open --json number -q 'length')" -eq 0 ]; then
gh pr create \
--base "$DEFAULT_BRANCH" \
--head "$BRANCH" \
--title "Merge ${TAG} manifest bump" \
--body "Automated manifest bump for [${TAG}](https://github.com/${{ github.repository }}/releases/tag/${TAG}). Merge after checks pass so \`${DEFAULT_BRANCH}\` matches the release."
else
echo "::notice::An open PR already exists for \`${BRANCH}\`; skipping \`gh pr create\`."
fi

- name: Summary
if: success()
Expand Down
Loading