Skip to content

Commit

Permalink
fix missing github token in environment value
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Jul 14, 2023
1 parent b97c3f1 commit 2b8f665
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/create_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -27,28 +28,29 @@ 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 \
-B main \
-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" \
| jq -c .[])
TITLE="$(echo $pr_data | jq -r '.title')"
echo $TITLE
gh pr edit ${{ github.ref_name }} \
-t "${TITLE} / ${{ steps.check_pr.outputs.message }}"
-t "${TITLE} / ${{ steps.check_pr.outputs.message }}"
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit 2b8f665

Please sign in to comment.