From dd09f27f25d500ec65191771f1fe22397f0a58a8 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:51:40 +0800 Subject: [PATCH] ci(protocol): release-please creates draft PRs (#18423) --- .github/workflows/repo--release-please.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/repo--release-please.yml b/.github/workflows/repo--release-please.yml index ea86a330f51..9b145a43659 100644 --- a/.github/workflows/repo--release-please.yml +++ b/.github/workflows/repo--release-please.yml @@ -18,7 +18,21 @@ jobs: release-please: runs-on: [arc-runner-set] steps: - - uses: googleapis/release-please-action@v4 + - name: Run Release Please + id: release_please + uses: googleapis/release-please-action@v4 with: token: ${{ secrets.RELEASE_PLEASE_TOKEN }} - draft: true + + - name: Convert PR to Draft + if: ${{ steps.release_please.outputs.pr != '' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pr_number=${{ steps.release_please.outputs.pr }} + echo "Converting PR #$pr_number to draft..." + curl -X PATCH \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + -d '{"draft":true}' \ + "https://api.github.com/repos/${{ github.repository }}/pulls/$pr_number" \ No newline at end of file