From 2b8f6655113a7a0bf15907cd201c2d51acf8dec3 Mon Sep 17 00:00:00 2001 From: Haruaki Tamada Date: Fri, 14 Jul 2023 15:07:53 +0900 Subject: [PATCH] fix missing github token in environment value --- .github/workflows/create_pull_request.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_pull_request.yml b/.github/workflows/create_pull_request.yml index 1995d3c..58c18d3 100644 --- a/.github/workflows/create_pull_request.yml +++ b/.github/workflows/create_pull_request.yml @@ -16,6 +16,7 @@ jobs: id: check_pr env: HEAD_MESSAGE: ${{ github.event.head_commit.message }} + GH_TOKEN: ${{ github.token }} run: | echo "github_ref ${GITHUB_REF}" echo "head_message: ${HEAD_MESSAGE}" @@ -27,11 +28,9 @@ jobs: echo "message=${COMMIT_MESSAGE}" >> "$GITHUB_OUTPUT" echo "tag: ${TAG}, check pr: $(gh pr list -S "Release v${TAG}"in:title)" echo "count=$(gh pr list -S "Release v${TAG}"in:title | wc -l)" >> "$GITHUB_OUTPUT" - + - name: Create Release Pull Request if: ${{ steps.check_pr.outputs.count == 0 }} - env: - GH_TOKEN: ${{ github.token }} run: | echo "count: ${{ steps.check_pr.outputs.count }}" gh pr create \ @@ -39,11 +38,11 @@ jobs: -t 'Release v${{ steps.check_pr.outputs.tag }} ${{ steps.check_pr.outputs.message }}' \ -a ${{ github.actor }} \ --body-file ./.github/RELEASE_WORKFLOW_TEMPLATE.md - - - name: Edit Release Pull Request - if: ${{ steps.check_pr.outputs.count != 0 }} env: GH_TOKEN: ${{ github.token }} + + - name: Edit Release Pull Request + if: ${{ steps.check_pr.outputs.count != 0 }} run: | pr_data=$(gh pr list -S 'Release v${{ steps.check_pr.outputs.tag }}'in:title \ --json "title" \ @@ -51,4 +50,7 @@ jobs: TITLE="$(echo $pr_data | jq -r '.title')" echo $TITLE gh pr edit ${{ github.ref_name }} \ - -t "${TITLE} / ${{ steps.check_pr.outputs.message }}" \ No newline at end of file + -t "${TITLE} / ${{ steps.check_pr.outputs.message }}" + env: + GH_TOKEN: ${{ github.token }} + \ No newline at end of file