From 0cbf7c47b1ac10163eed9618195bade677811f4b Mon Sep 17 00:00:00 2001 From: Krzysztof Szyper <45788587+ChristophShyper@users.noreply.github.com> Date: Thu, 3 Nov 2022 09:55:32 +0100 Subject: [PATCH 1/2] Add pr_number to outputs As requested in https://github.com/devops-infra/action-pull-request/issues/104 Also updated setting outputs to a new format. --- README.md | 7 ++++--- entrypoint.sh | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4319fe6..6314230 100644 --- a/README.md +++ b/README.md @@ -78,9 +78,10 @@ Features: | title | No | *subject of the first commit* | Pull request title. | -| Outputs | Description | -| ------- | ---------------- | -| url | Pull request URL | +| Outputs | Description | +| --------- | ----------------------------- | +| url | Pull request URL | +| pr_number | Number of GitHub pull request | ### How get_diff works diff --git a/entrypoint.sh b/entrypoint.sh index 1443739..66ae8bd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -165,7 +165,7 @@ if [[ -z "${PR_NUMBER}" ]]; then echo -e "\n${TEMPLATE}" >> /tmp/template echo -e "\nTemplate:" cat /tmp/template - # shellcheck disable=SC2016 + # shellcheck disable=SC2016,SC2124 COMMAND="hub pull-request -b ${TARGET_BRANCH} -h ${SOURCE_BRANCH} --no-edit ${ARG_LIST[@]}" echo -e "\nRunning: ${COMMAND}" URL=$(sh -c "${COMMAND}") @@ -181,7 +181,10 @@ else fi # Finish -echo "::set-output name=url::${URL}" +{ + echo "url=${URL}" + echo "pr_number=${PR_NUMBER}" +} >> "$GITHUB_OUTPUT" if [[ ${RET_CODE} != "0" ]]; then echo -e "\n[ERROR] Check log for errors." exit 1 From 2af0cab91174929b77914aac3f59a1caec65f984 Mon Sep 17 00:00:00 2001 From: Krzysztof Szyper <45788587+ChristophShyper@users.noreply.github.com> Date: Thu, 3 Nov 2022 09:59:20 +0100 Subject: [PATCH 2/2] Bump release to v0.5.2 --- Makefile | 2 +- README.md | 6 +++--- action.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 458c832..46475e8 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ phony: help # Release tag for the action -VERSION := v0.5.0 +VERSION := v0.5.2 # GitHub Actions bogus variables GITHUB_REF ?= refs/heads/null diff --git a/README.md b/README.md index 6314230..4138ce9 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.0 + uses: devops-infra/action-pull-request@v0.5.2 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.0 + uses: devops-infra/action-pull-request@v0.5.2 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.0 + uses: devops-infra/action-pull-request@v0.5.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} title: ${{ github.event.commits[0].message }} diff --git a/action.yml b/action.yml index 4a53a1a..558a106 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.0 + image: docker://devopsinfra/action-pull-request:v0.5.2 env: GITHUB_TOKEN: ${{ inputs.github_token }} branding: