You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v6.x.x`
38
+
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v7.x.x`
39
39
40
40
### Workflow permissions
41
41
@@ -48,12 +48,10 @@ For repositories belonging to an organization, this setting can be managed by ad
48
48
49
49
All inputs are **optional**. If not set, sensible defaults will be used.
50
50
51
-
**Note**: If you want pull requests created by this action to trigger an `on: push` or `on: pull_request` workflow then you cannot use the default `GITHUB_TOKEN`. See the [documentation here](docs/concepts-guidelines.md#triggering-further-workflow-runs) for workarounds.
52
-
53
51
| Name | Description | Default |
54
52
| --- | --- | --- |
55
-
| `token` | `GITHUB_TOKEN` (permissions `contents: write` and `pull-requests: write`) or a `repo` scoped [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). | `GITHUB_TOKEN` |
56
-
| `git-token` | The [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) that the action will use for git operations. | Defaults to the value of `token` |
53
+
| `token` | The token that the action will use to create and update the pull request. See [token](#token). | `GITHUB_TOKEN` |
54
+
| `branch-token` | The token that the action will use to create and update the branch. See [branch-token](#branch-token). | Defaults to the value of `token` |
57
55
| `path` | Relative path under `GITHUB_WORKSPACE` to the repository. | `GITHUB_WORKSPACE` |
58
56
| `add-paths` | A comma or newline-separated list of file paths to commit. Paths should follow git's [pathspec](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec) syntax. If no paths are specified, all new and modified files are added. See [Add specific paths](#add-specific-paths). | |
59
57
| `commit-message` | The message to use when committing changes. See [commit-message](#commit-message). | `[create-pull-request] automated change` |
@@ -65,6 +63,7 @@ All inputs are **optional**. If not set, sensible defaults will be used.
65
63
| `branch-suffix` | The branch suffix type when using the alternative branching strategy. Valid values are `random`, `timestamp` and `short-commit-hash`. See [Alternative strategy](#alternative-strategy---always-create-a-new-pull-request-branch) for details. | |
66
64
| `base` | Sets the pull request base branch. | Defaults to the branch checked out in the workflow. |
67
65
| `push-to-fork` | A fork of the checked-out parent repository to which the pull request branch will be pushed. e.g. `owner/repo-fork`. The pull request will be created to merge the fork's branch into the parent's base. See [push pull request branches to a fork](docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork) for details. | |
66
+
| `sign-commits` | Sign commits as `github-actions[bot]` when using `GITHUB_TOKEN`, or your own bot when using [GitHub App tokens](docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens). See [commit signing](docs/concepts-guidelines.md#commit-signature-verification-for-bots) for details. | `false` |
68
67
| `title` | The title of the pull request. | `Changes by create-pull-request action` |
69
68
| `body` | The body of the pull request. | `Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action` |
70
69
| `body-path` | The path to a file containing the pull request body. Takes precedence over `body`. | |
@@ -73,7 +72,35 @@ All inputs are **optional**. If not set, sensible defaults will be used.
73
72
| `reviewers` | A comma or newline-separated list of reviewers (GitHub usernames) to request a review from. | |
74
73
| `team-reviewers` | A comma or newline-separated list of GitHub teams to request a review from. Note that a `repo` scoped [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token), or equivalent [GitHub App permissions](docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens), are required. | |
75
74
| `milestone` | The number of the milestone to associate this pull request with. | |
76
-
| `draft` | Create a [draft pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests). It is not possible to change draft status after creation except through the web interface. | `false` |
75
+
| `draft` | Create a [draft pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests). Valid values are `true` (only on create), `always-true` (on create and update), and `false`. | `false` |
76
+
| `maintainer-can-modify` | Indicates whether [maintainers can modify](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) the pull request. | `true` |
77
+
78
+
#### token
79
+
80
+
The token input defaults to the repository's `GITHUB_TOKEN`.
81
+
82
+
> [!IMPORTANT]
83
+
> - If you want pull requests created by this action to trigger an `on: push` or `on: pull_request` workflow then you cannot use the default `GITHUB_TOKEN`. See the [documentation here](docs/concepts-guidelines.md#triggering-further-workflow-runs) for further details.
84
+
> - If using the repository's `GITHUB_TOKEN` and your repository was created after 2nd February 2023, the [default permission is read-only](https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/). Elevate the [permissions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token#defining-access-for-the-github_token-permissions) in your workflow.
85
+
> ```yml
86
+
> permissions:
87
+
> contents: write
88
+
> pull-requests: write
89
+
> ```
90
+
91
+
Other token options:
92
+
- Classic [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with `repo` scope.
93
+
- Fine-grained [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) with `contents: write` and `pull-requests: write` scopes.
94
+
- [GitHub App tokens](docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens) with `contents: write` and `pull-requests: write` scopes.
95
+
96
+
> [!TIP]
97
+
> If pull requests could contain changes to Actions workflows you may also need the `workflows` scope.
98
+
99
+
#### branch-token
100
+
101
+
The action first creates a branch, and then creates a pull request for the branch.
102
+
For some rare use cases it can be useful, or even necessary, to use different tokens for these operations.
103
+
It is not advisable to use this input unless you know you need to.
77
104
78
105
#### commit-message
79
106
@@ -104,7 +131,7 @@ If you want branches to be deleted immediately on merge then you should use GitH
104
131
For self-hosted runners behind a corporate proxy set the `https_proxy` environment variable.
105
132
```yml
106
133
- name: Create Pull Request
107
-
uses: peter-evans/create-pull-request@v6
134
+
uses: peter-evans/create-pull-request@v7
108
135
env:
109
136
https_proxy: http://<proxy_address>:<port>
110
137
```
@@ -115,17 +142,18 @@ The following outputs can be used by subsequent workflow steps.
115
142
116
143
- `pull-request-number`- The pull request number.
117
144
- `pull-request-url`- The URL of the pull request.
118
-
- `pull-request-operation`- The pull request operation performed by the action, `created`, `updated`or `closed`.
145
+
- `pull-request-operation`- The pull request operation performed by the action, `created`, `updated`, `closed` or `none`.
119
146
- `pull-request-head-sha`- The commit SHA of the pull request branch.
120
147
- `pull-request-branch`- The branch name of the pull request.
148
+
- `pull-request-commits-verified`- Whether GitHub considers the signature of the branch's commits to be verified; `true` or `false`.
121
149
122
150
Step outputs can be accessed as in the following example.
123
151
Note that in order to read the step outputs the action step must have an id.
124
152
125
153
```yml
126
154
- name: Create Pull Request
127
155
id: cpr
128
-
uses: peter-evans/create-pull-request@v6
156
+
uses: peter-evans/create-pull-request@v7
129
157
- name: Check outputs
130
158
if: ${{ steps.cpr.outputs.pull-request-number }}
131
159
run: |
@@ -188,7 +216,7 @@ File changes that do not match one of the paths will be stashed and restored aft
188
216
189
217
```yml
190
218
- name: Create Pull Request
191
-
uses: peter-evans/create-pull-request@v6
219
+
uses: peter-evans/create-pull-request@v7
192
220
with:
193
221
add-paths: |
194
222
*.java
@@ -215,25 +243,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
215
243
- name: Uncommitted change
216
244
run: date +%s > report.txt
217
245
- name: Create Pull Request
218
-
uses: peter-evans/create-pull-request@v6
219
-
```
220
-
221
-
### Create a project card
222
-
223
-
To create a project card for the pull request, pass the `pull-request-number` step output to [create-or-update-project-card](https://github.com/peter-evans/create-or-update-project-card) action.
0 commit comments