Fix bug when updating a pull request

This commit is contained in:
Peter Evans 2019-11-10 16:56:55 +09:00
parent 3c86e9a421
commit 006313b45a
5 changed files with 12 additions and 12 deletions

View File

@ -19,7 +19,7 @@ See [examples](examples.md) for detailed use cases.
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
```
@ -55,7 +55,7 @@ Note that in order to read the step output the action step must have an id.
```yml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check outputs
@ -105,7 +105,7 @@ jobs:
run: date +%s > report.txt
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Add report file

View File

@ -120,7 +120,7 @@ def process_event(github_token, github_repository, repo, branch, base):
pull_request = github_repo.get_pulls(
state='open',
base=base,
head=branch)[1]
head=branch)[0]
print("Updated pull request #%d (%s => %s)" %
(pull_request.number, branch, base))
else:

View File

@ -41,7 +41,7 @@ jobs:
ncu -u
npm install
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: update dependencies
@ -75,7 +75,7 @@ jobs:
- run: echo "##[set-output name=pr_title;]update to latest Go release ${{ steps.ensure_go.outputs.go_version}}"
id: pr_title_maker
- name: Create pull request
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: ${{ steps.pr_title_maker.outputs.pr_title }}
@ -110,7 +110,7 @@ jobs:
--domains quotes.toscrape.com \
http://quotes.toscrape.com/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: update local website copy
@ -202,7 +202,7 @@ jobs:
run: echo ::set-output name=branch-name::"autopep8-patches/$GITHUB_HEAD_REF"
- name: Create Pull Request
if: steps.autopep8.outputs.exit-code == 2
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: autopep8 action fixes
@ -249,7 +249,7 @@ The recommended method is to use [`set-output`](https://help.github.com/en/githu
echo ::set-output name=pr_body::"This PR was auto-generated on $(date +%d-%m-%Y) \
by [create-pull-request](https://github.com/peter-evans/create-pull-request)."
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: ${{ steps.vars.outputs.pr_title }}
@ -265,7 +265,7 @@ Alternatively, [`set-env`](https://help.github.com/en/github/automating-your-wor
echo ::set-env name=PULL_REQUEST_BODY::"This PR was auto-generated on $(date +%d-%m-%Y) \
by [create-pull-request](https://github.com/peter-evans/create-pull-request)."
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.7.0
uses: peter-evans/create-pull-request@v1.7.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: ${{ env.PULL_REQUEST_TITLE }}

View File

@ -1,6 +1,6 @@
{
"name": "create-pull-request",
"version": "1.7.0",
"version": "1.7.1",
"description": "Creates a pull request for changes to your repository in the actions workspace",
"main": "index.js",
"scripts": {

View File

@ -120,7 +120,7 @@ def process_event(github_token, github_repository, repo, branch, base):
pull_request = github_repo.get_pulls(
state='open',
base=base,
head=branch)[1]
head=branch)[0]
print("Updated pull request #%d (%s => %s)" %
(pull_request.number, branch, base))
else: