diff --git a/Makefile b/Makefile index 5f9caa5..00703a8 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ phony: help # Release tag for the action -VERSION := v0.5.3 +VERSION := v0.5.4 # GitHub Actions bogus variables GITHUB_REF ?= refs/heads/null diff --git a/README.md b/README.md index 89c1975..ac035c3 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Features: ```yaml - name: Run the Action - uses: devops-infra/action-pull-request@v0.5.3 + uses: devops-infra/action-pull-request@v0.5.4 with: github_token: ${{ secrets.GITHUB_TOKEN }} source_branch: development @@ -119,7 +119,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - name: Create pull request - uses: devops-infra/action-pull-request@v0.5.3 + uses: devops-infra/action-pull-request@v0.5.4 with: github_token: ${{ secrets.GITHUB_TOKEN }} title: Automatic pull request @@ -141,7 +141,7 @@ jobs: fetch-depth: 0 - name: Run the Action if: startsWith(github.ref, 'refs/heads/feature') - uses: devops-infra/action-pull-request@v0.5.3 + uses: devops-infra/action-pull-request@v0.5.4 with: github_token: ${{ secrets.GITHUB_TOKEN }} title: ${{ github.event.commits[0].message }} diff --git a/action.yml b/action.yml index 1417a69..a771c82 100644 --- a/action.yml +++ b/action.yml @@ -69,7 +69,7 @@ outputs: description: Pull request URL. runs: using: docker - image: docker://devopsinfra/action-pull-request:v0.5.3 + image: docker://devopsinfra/action-pull-request:v0.5.4 env: GITHUB_TOKEN: ${{ inputs.github_token }} branding: diff --git a/entrypoint.sh b/entrypoint.sh index cdd919f..cc72d2f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -171,6 +171,7 @@ if [[ -z "${PR_NUMBER}" ]]; then URL=$(sh -c "${COMMAND}") # shellcheck disable=SC2181 if [[ "$?" != "0" ]]; then RET_CODE=1; fi + PR_NUMBER=$(gh pr view --json number -q .number "${URL}") else echo -e "\nUpdating pull request" COMMAND="hub api --method PATCH repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER} --field 'body=@/tmp/template'"