Skip to content

Commit

Permalink
Add pr_number to outputs
Browse files Browse the repository at this point in the history
As requested in #104

Also updated setting outputs to a new format.
  • Loading branch information
ChristophShyper committed Nov 3, 2022
1 parent 2dea7a8 commit 0cbf7c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand All @@ -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
Expand Down

0 comments on commit 0cbf7c4

Please sign in to comment.