From cf92051517bfe2049eb11ffa139ed0a383618ba9 Mon Sep 17 00:00:00 2001 From: Naka Masato Date: Mon, 14 Nov 2022 13:51:00 +0900 Subject: [PATCH] Update create-pr-when-pr-is-merged.yml --- .github/workflows/create-pr-when-pr-is-merged.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-pr-when-pr-is-merged.yml b/.github/workflows/create-pr-when-pr-is-merged.yml index 449052cb..3ad1c52b 100644 --- a/.github/workflows/create-pr-when-pr-is-merged.yml +++ b/.github/workflows/create-pr-when-pr-is-merged.yml @@ -61,7 +61,11 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # used by gh run: | - echo "count=$(gh pr list -S head:${{ env.BRANCH_NAME }} -B ${{ env.BASE_BRANCH_NAME }} | wc -l)" >> "$GITHUB_OUTPUT" + # echo "count=$(gh pr list -S head:${{ env.BRANCH_NAME }} -B ${{ env.BASE_BRANCH_NAME }} | wc -l)" >> "$GITHUB_OUTPUT" + pulls=$(curl -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/nakamasato/github-actions-practice/pulls?head=nakamasato:${{ env.BRANCH_NAME }}&base=${{ env.BASE_BRANCH_NAME }}") + echo "$pulls" + count=$(echo "$pulls" | jq '. | length') + echo "count=$count" >> "$GITHUB_OUTPUT" - name: create pr if: ${{ steps.need_commit.outputs.need_commit == 'true' && steps.check_pr.outputs.count == 0 }}