From d657c076a43ea71c7e74fac2a3e4feb8d68e95ad Mon Sep 17 00:00:00 2001 From: sendbird-client-release Date: Thu, 15 Oct 2026 08:19:06 +0000 Subject: [PATCH] release 0.1.44 --- .github/workflows/auto-merge-release.yml | 82 ------------------------ 1 file changed, 82 deletions(-) delete mode 100644 .github/workflows/auto-merge-release.yml diff --git a/.github/workflows/auto-merge-release.yml b/.github/workflows/auto-merge-release.yml deleted file mode 100644 index 23904ea..0000000 --- a/.github/workflows/auto-merge-release.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: auto-merge-release -# Release pull requests (release/* opened by the publishing bot) merge on their own once -# `validate` passes: a second bot account approves (a PR author cannot approve its own PR), -# then the publishing bot merges. When the release also needs a code owner's approval, the -# bot turns on GitHub auto-merge, so that approval alone completes the release. Anything -# else waits for a human. -on: - workflow_run: - workflows: [validate] - types: [completed] -permissions: - contents: read - pull-requests: read - checks: read - statuses: read - actions: read -jobs: - merge: - if: >- - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_repository.full_name == github.repository && - startsWith(github.event.workflow_run.head_branch, 'release/') - runs-on: ubuntu-latest - env: - BRANCH: ${{ github.event.workflow_run.head_branch }} - REPO: ${{ github.repository }} - BOT: sendbird-sdk-deployment - steps: - - name: Resolve the release PR - id: pr - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - num=$(gh pr list --repo "$REPO" --head "$BRANCH" --state open --json number,author \ - --jq ".[] | select(.author.login==\"$BOT\") | .number" | head -1) - if [ -z "$num" ]; then echo "No open release PR by $BOT on $BRANCH."; echo "skip=1" >> "$GITHUB_OUTPUT"; exit 0; fi - echo "number=$num" >> "$GITHUB_OUTPUT" - - name: Approve - if: steps.pr.outputs.skip != '1' - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_FOR_PR_APPROVAL }} - PR: ${{ steps.pr.outputs.number }} - run: | - [ "$(gh pr view "$PR" --repo "$REPO" --json reviewDecision --jq .reviewDecision)" = APPROVED ] \ - || gh pr review "$PR" --repo "$REPO" --approve --body "Auto-approved: release PR, validate green." \ - || echo "approve failed (already reviewed or no approval rule) — continuing" - - name: Wait for every check - if: steps.pr.outputs.skip != '1' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR: ${{ steps.pr.outputs.number }} - run: | - # Organization checks (secret scan, code scan) finish after validate and send no - # workflow_run event, so wait for them here. - rc=0 - timeout 15m gh pr checks "$PR" --repo "$REPO" --watch --fail-fast || rc=$? - case "$rc" in - 0) echo "All checks green on PR #$PR." ;; - *) echo "Checks not green (rc=$rc) — leaving PR #$PR for a human."; exit 1 ;; - esac - - name: Merge now, or when the code owner approves - if: steps.pr.outputs.skip != '1' - env: - GH_TOKEN: ${{ secrets.GH_API_TOKEN }} - PR: ${{ steps.pr.outputs.number }} - run: | - # A release that changes hooks, core, tools, or CI needs a code owner's approval - # (repository ruleset), which arrives after this run. Waiting here would time out, so - # turn on GitHub auto-merge instead: GitHub merges the moment every requirement is met, - # and the merge starts release-zip as usual. Mergeable already: merge now. - for i in 1 2 3 4 5 6; do - state=$(gh pr view "$PR" --repo "$REPO" --json mergeStateStatus --jq .mergeStateStatus) - echo "attempt $i: $state" - case "$state" in - CLEAN) gh pr merge "$PR" --repo "$REPO" --squash --delete-branch && exit 0 ;; - BLOCKED) gh pr merge "$PR" --repo "$REPO" --squash --delete-branch --auto \ - && { echo "Auto-merge on: PR #$PR merges when the code owner approves."; exit 0; } ;; - UNSTABLE|UNKNOWN) sleep 10 ;; - *) echo "State=$state — leaving for a human."; exit 0 ;; - esac - done - exit 1