Skip to content

Commit 78bacf8

Browse files
Merge pull request #106 from devops-infra/feature/pr-number
Add pr_number to outputs
2 parents 2dea7a8 + 2af0cab commit 78bacf8

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
phony: help
33

44
# Release tag for the action
5-
VERSION := v0.5.0
5+
VERSION := v0.5.2
66

77
# GitHub Actions bogus variables
88
GITHUB_REF ?= refs/heads/null

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Features:
3737

3838
```yaml
3939
- name: Run the Action
40-
uses: devops-infra/[email protected].0
40+
uses: devops-infra/[email protected].2
4141
with:
4242
github_token: ${{ secrets.GITHUB_TOKEN }}
4343
source_branch: development
@@ -78,9 +78,10 @@ Features:
7878
| title | No | *subject of the first commit* | Pull request title. |
7979

8080

81-
| Outputs | Description |
82-
| ------- | ---------------- |
83-
| url | Pull request URL |
81+
| Outputs | Description |
82+
| --------- | ----------------------------- |
83+
| url | Pull request URL |
84+
| pr_number | Number of GitHub pull request |
8485

8586

8687
### How get_diff works
@@ -118,7 +119,7 @@ jobs:
118119
- name: Checkout repository
119120
uses: actions/checkout@v2
120121
- name: Create pull request
121-
uses: devops-infra/[email protected].0
122+
uses: devops-infra/[email protected].2
122123
with:
123124
github_token: ${{ secrets.GITHUB_TOKEN }}
124125
title: Automatic pull request
@@ -140,7 +141,7 @@ jobs:
140141
fetch-depth: 0
141142
- name: Run the Action
142143
if: startsWith(github.ref, 'refs/heads/feature')
143-
uses: devops-infra/[email protected].0
144+
uses: devops-infra/[email protected].2
144145
with:
145146
github_token: ${{ secrets.GITHUB_TOKEN }}
146147
title: ${{ github.event.commits[0].message }}

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ outputs:
6969
description: Pull request URL.
7070
runs:
7171
using: docker
72-
image: docker://devopsinfra/action-pull-request:v0.5.0
72+
image: docker://devopsinfra/action-pull-request:v0.5.2
7373
env:
7474
GITHUB_TOKEN: ${{ inputs.github_token }}
7575
branding:

entrypoint.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ if [[ -z "${PR_NUMBER}" ]]; then
165165
echo -e "\n${TEMPLATE}" >> /tmp/template
166166
echo -e "\nTemplate:"
167167
cat /tmp/template
168-
# shellcheck disable=SC2016
168+
# shellcheck disable=SC2016,SC2124
169169
COMMAND="hub pull-request -b ${TARGET_BRANCH} -h ${SOURCE_BRANCH} --no-edit ${ARG_LIST[@]}"
170170
echo -e "\nRunning: ${COMMAND}"
171171
URL=$(sh -c "${COMMAND}")
@@ -181,7 +181,10 @@ else
181181
fi
182182

183183
# Finish
184-
echo "::set-output name=url::${URL}"
184+
{
185+
echo "url=${URL}"
186+
echo "pr_number=${PR_NUMBER}"
187+
} >> "$GITHUB_OUTPUT"
185188
if [[ ${RET_CODE} != "0" ]]; then
186189
echo -e "\n[ERROR] Check log for errors."
187190
exit 1

0 commit comments

Comments
 (0)