Skip to content

ci(update-marketplace): auto-merge the snapshot PR#45

Merged
sf-jin-ku merged 1 commit into
mainfrom
jin/auto-merge-marketplace-pr
May 12, 2026
Merged

ci(update-marketplace): auto-merge the snapshot PR#45
sf-jin-ku merged 1 commit into
mainfrom
jin/auto-merge-marketplace-pr

Conversation

@sf-jin-ku
Copy link
Copy Markdown
Contributor

Summary

The marketplace update workflow currently stops at `gh pr create` — every release lands on npm immediately but the corresponding marketplace snapshot PR sits open until a human notices and merges. v1.2.0 sat for ~30 minutes that way.

Capture the PR number (whether newly created or already open from a prior run) and run `gh pr merge --squash --admin --delete-branch` against it with the same marketplace push token. Auto-snapshot PRs are deterministic from the source tag, so admin bypass of branch protection is appropriate here. If the token lacks admin rights the merge step fails loudly and the open PR remains for manual recovery — strictly better than the current silent forget-forever behavior.

Test plan

  • YAML syntax validates
  • First future release tag will exercise the new merge step end-to-end
  • If the token doesn't have admin on `sendbird/codex-marketplace`, surface the failure visibly so we can grant it

🤖 Generated with Claude Code

The release pipeline split into two paths: npm publish (runs and ships
to the registry) and marketplace snapshot (opens a PR against
sendbird/codex-marketplace). Until now the marketplace step stopped at
PR creation, so every release sat in PR limbo until a human noticed and
merged it. We forgot v1.2.0 for half an hour the same way.

Capture the PR number after create/reuse and run `gh pr merge --squash
--admin --delete-branch` against it with the marketplace push token.
Auto-snapshot PRs are deterministic from the source tag, so admin
bypass of branch protection is appropriate here. If the token does not
have admin rights on the marketplace repo, the merge step fails loudly
and the open PR remains for manual recovery — strictly better than the
current behavior of leaving it open forever.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sf-jin-ku sf-jin-ku merged commit f0ebf96 into main May 12, 2026
5 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ef97428c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +109 to +113
PR_NUMBER=$(gh pr list \
--repo "$MARKETPLACE_REPO" \
--head "$BRANCH_NAME" \
--json number \
--jq '.[0].number // empty')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail when PR lookup returns empty after creation

After creating a PR, the workflow re-fetches it with gh pr list and then unconditionally exports pr_number even if that query returns empty. The merge step is gated on pr_number != '', so an empty lookup makes the job succeed without merging and reintroduces the “PR left open forever” behavior this change is trying to eliminate. gh pr create already reports the created PR URL; at minimum, assert PR_NUMBER is non-empty and exit 1 when it is not so the run fails loudly instead of silently skipping merge.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant