Skip to content

Commit 7e7150d

Browse files
authored
Merge pull request #147 from peter-evans/dev
Default token to github.token
2 parents 115b739 + eb99d45 commit 7e7150d

File tree

5 files changed

+4
-29
lines changed

5 files changed

+4
-29
lines changed

.github/workflows/cpr-example-command.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
id: cpr
1414
uses: ./
1515
with:
16-
token: ${{ secrets.GITHUB_TOKEN }}
1716
commit-message: Add report file
1817
committer: Peter Evans <[email protected]>
1918
title: '[Example] Add report file'

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,20 @@ Create Pull Request action will:
2727
```yml
2828
- name: Create Pull Request
2929
uses: peter-evans/create-pull-request@v2
30-
with:
31-
token: ${{ secrets.GITHUB_TOKEN }}
3230
```
3331
3432
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v2.x.x`
3533

3634
### Action inputs
3735

38-
With the exception of `token`, all inputs are **optional**. If not set, sensible default values will be used.
36+
All inputs are **optional**. If not set, sensible default values will be used.
3937

4038
**Note**: If you want pull requests created by this action to trigger an `on: push` or `on: pull_request` workflow then you must use a [Personal Access Token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) instead of the default `GITHUB_TOKEN`. Alternatively, allow the action to [push using SSH](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#push-using-ssh-deploy-keys) by configuring a deploy key.
4139

4240
| Name | Description | Default |
4341
| --- | --- | --- |
44-
| `token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). | |
45-
| `path` | Relative path under `$GITHUB_WORKSPACE` to the repository. | `$GITHUB_WORKSPACE` |
42+
| `token` | `GITHUB_TOKEN` or a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). | `GITHUB_TOKEN` |
43+
| `path` | Relative path under `GITHUB_WORKSPACE` to the repository. | `GITHUB_WORKSPACE` |
4644
| `commit-message` | The message to use when committing changes. | `[create-pull-request] automated change` |
4745
| `committer` | The committer name and email address in the format `Display Name <[email protected]>`. | Defaults to the GitHub Actions bot user. See [Committer and author](#committer-and-author) for details. |
4846
| `author` | The author name and email address in the format `Display Name <[email protected]>`. | Defaults to the GitHub Actions bot user. See [Committer and author](#committer-and-author) for details. |
@@ -69,8 +67,6 @@ Note that in order to read the step output the action step must have an id.
6967
- name: Create Pull Request
7068
id: cpr
7169
uses: peter-evans/create-pull-request@v2
72-
with:
73-
token: ${{ secrets.GITHUB_TOKEN }}
7470
- name: Check outputs
7571
run: |
7672
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
@@ -120,7 +116,6 @@ In most cases, where the committer and author are the same, just the committer c
120116
- name: Create Pull Request
121117
uses: peter-evans/create-pull-request@v2
122118
with:
123-
token: ${{ secrets.GITHUB_TOKEN }}
124119
committer: Peter Evans <[email protected]>
125120
```
126121

@@ -144,8 +139,6 @@ As well as relying on the action to handle uncommitted changes, you can addition
144139
run: date +%s > report.txt
145140
- name: Create Pull Request
146141
uses: peter-evans/create-pull-request@v2
147-
with:
148-
token: ${{ secrets.GITHUB_TOKEN }}
149142
```
150143

151144
## Reference Example

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Creates a pull request for changes to your repository in the actio
33
inputs:
44
token:
55
description: 'GITHUB_TOKEN or a repo scoped PAT'
6-
required: true
6+
default: ${{ github.token }}
77
path:
88
description: 'Relative path under $GITHUB_WORKSPACE to the repository.'
99
commit-message:

docs/concepts-guidelines.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ How to use SSH (deploy keys) with create-pull-request action:
177177

178178
- name: Create Pull Request
179179
uses: peter-evans/create-pull-request@v2
180-
with:
181-
token: ${{ secrets.GITHUB_TOKEN }}
182180
```
183181
184182
### Push pull request branches to a fork
@@ -236,8 +234,6 @@ jobs:
236234
237235
- name: Create Pull Request
238236
uses: peter-evans/create-pull-request@v2
239-
with:
240-
token: ${{ secrets.GITHUB_TOKEN }}
241237
```
242238

243239
**Ubuntu container example:**
@@ -261,8 +257,6 @@ jobs:
261257
262258
- name: Create Pull Request
263259
uses: peter-evans/create-pull-request@v2
264-
with:
265-
token: ${{ secrets.GITHUB_TOKEN }}
266260
```
267261

268262
### Creating pull requests on tag push
@@ -296,7 +290,6 @@ jobs:
296290
- name: Create Pull Request
297291
uses: peter-evans/create-pull-request@v2
298292
with:
299-
token: ${{ secrets.GITHUB_TOKEN }}
300293
base: master
301294
302295
- name: Delete tag branch
@@ -324,6 +317,4 @@ jobs:
324317
325318
- name: Create Pull Request
326319
uses: peter-evans/create-pull-request@v2
327-
with:
328-
token: ${{ secrets.GITHUB_TOKEN }}
329320
```

docs/examples.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
- name: Create Pull Request
4646
uses: peter-evans/create-pull-request@v2
4747
with:
48-
token: ${{ secrets.GITHUB_TOKEN }}
4948
commit-message: update authors
5049
title: Update AUTHORS
5150
body: Credit new contributors by updating AUTHORS
@@ -78,7 +77,6 @@ jobs:
7877
- name: Create Pull Request
7978
uses: peter-evans/create-pull-request@v2
8079
with:
81-
token: ${{ secrets.GITHUB_TOKEN }}
8280
branch: production-promotion
8381
```
8482
@@ -110,7 +108,6 @@ jobs:
110108
- name: Create Pull Request
111109
uses: peter-evans/create-pull-request@v2
112110
with:
113-
token: ${{ secrets.GITHUB_TOKEN }}
114111
commit-message: update dependencies
115112
title: Automated Dependency Updates
116113
body: This is an auto-generated PR with dependency updates.
@@ -161,7 +158,6 @@ jobs:
161158
- name: Create Pull Request
162159
uses: peter-evans/create-pull-request@v2
163160
with:
164-
token: ${{ secrets.GITHUB_TOKEN }}
165161
commit-message: Update swagger-ui to ${{ steps.swagger-ui.outputs.release_tag }}
166162
title: Update SwaggerUI to ${{ steps.swagger-ui.outputs.release_tag }}
167163
body: |
@@ -204,7 +200,6 @@ jobs:
204200
- name: Create Pull Request
205201
uses: peter-evans/create-pull-request@v2
206202
with:
207-
token: ${{ secrets.GITHUB_TOKEN }}
208203
commit-message: update local website copy
209204
title: Automated Updates to Local Website Copy
210205
body: This is an auto-generated PR with website updates.
@@ -299,7 +294,6 @@ jobs:
299294
if: steps.autopep8.outputs.exit-code == 2
300295
uses: peter-evans/create-pull-request@v2
301296
with:
302-
token: ${{ secrets.GITHUB_TOKEN }}
303297
commit-message: autopep8 action fixes
304298
title: Fixes by autopep8 action
305299
body: This is an auto-generated PR with fixes by autopep8.
@@ -358,7 +352,6 @@ The recommended method is to use [`set-output`](https://help.github.com/en/githu
358352
- name: Create Pull Request
359353
uses: peter-evans/create-pull-request@v2
360354
with:
361-
token: ${{ secrets.GITHUB_TOKEN }}
362355
title: ${{ steps.vars.outputs.pr_title }}
363356
body: ${{ steps.vars.outputs.pr_body }}
364357
```
@@ -374,7 +367,6 @@ Alternatively, [`set-env`](https://help.github.com/en/github/automating-your-wor
374367
- name: Create Pull Request
375368
uses: peter-evans/create-pull-request@v2
376369
with:
377-
token: ${{ secrets.GITHUB_TOKEN }}
378370
title: ${{ env.PULL_REQUEST_TITLE }}
379371
body: ${{ env.PULL_REQUEST_BODY }}
380372
```

0 commit comments

Comments
 (0)