Keep env var output for backwards compat
This commit is contained in:
parent
3c32fac1fe
commit
5429e57002
3
.github/workflows/cpr-example-command.yml
vendored
3
.github/workflows/cpr-example-command.yml
vendored
|
@ -33,9 +33,8 @@ jobs:
|
|||
branch: example-patches
|
||||
request-to-parent: false
|
||||
|
||||
- name: Check outputs
|
||||
- name: Check output
|
||||
run: |
|
||||
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
|
||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
|
||||
- name: Add reaction
|
||||
|
|
11
README.md
11
README.md
|
@ -62,7 +62,7 @@ All inputs are **optional**. If not set, sensible default values will be used.
|
|||
|
||||
### Action outputs
|
||||
|
||||
The pull request number is output as both an environment variable and a step output.
|
||||
The pull request number is output as a step output.
|
||||
Note that in order to read the step output the action step must have an id.
|
||||
|
||||
```yml
|
||||
|
@ -71,7 +71,6 @@ Note that in order to read the step output the action step must have an id.
|
|||
uses: peter-evans/create-pull-request@v2
|
||||
- name: Check outputs
|
||||
run: |
|
||||
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
|
||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
```
|
||||
|
||||
|
@ -184,8 +183,10 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Create report file
|
||||
|
||||
- name: Make changes to pull request
|
||||
run: date +%s > report.txt
|
||||
|
||||
- name: Create Pull Request
|
||||
id: cpr
|
||||
uses: peter-evans/create-pull-request@v2
|
||||
|
@ -209,9 +210,9 @@ jobs:
|
|||
draft: false
|
||||
branch: example-patches
|
||||
request-to-parent: false
|
||||
- name: Check outputs
|
||||
|
||||
- name: Check output
|
||||
run: |
|
||||
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
|
||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
```
|
||||
|
||||
|
|
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -8084,8 +8084,11 @@ class GitHubHelper {
|
|||
const headBranch = `${headRepo.owner.login}:${inputs.branch}`;
|
||||
// Create or update the pull request
|
||||
const pullNumber = yield this.createOrUpdate(inputs, baseRepository, headBranch);
|
||||
// Set output
|
||||
// Set outputs
|
||||
core.startGroup('Setting outputs');
|
||||
core.setOutput('pull-request-number', pullNumber);
|
||||
core.exportVariable('PULL_REQUEST_NUMBER', pullNumber);
|
||||
core.endGroup();
|
||||
// Set milestone, labels and assignees
|
||||
const updateIssueParams = {};
|
||||
if (inputs.milestone) {
|
||||
|
|
|
@ -103,8 +103,11 @@ export class GitHubHelper {
|
|||
headBranch
|
||||
)
|
||||
|
||||
// Set output
|
||||
// Set outputs
|
||||
core.startGroup('Setting outputs')
|
||||
core.setOutput('pull-request-number', pullNumber)
|
||||
core.exportVariable('PULL_REQUEST_NUMBER', pullNumber)
|
||||
core.endGroup()
|
||||
|
||||
// Set milestone, labels and assignees
|
||||
const updateIssueParams = {}
|
||||
|
|
Loading…
Reference in a new issue