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
-[Concepts, guidelines and advanced usage](docs/concepts-guidelines.md)
23
23
-[Examples](docs/examples.md)
24
-
-[Updating from v1](docs/updating.md)
24
+
-[Updating to v3](docs/updating.md)
25
25
26
26
## Usage
27
27
28
28
```yml
29
29
- name: Create Pull Request
30
-
uses: peter-evans/create-pull-request@v2
30
+
uses: peter-evans/create-pull-request@v3
31
31
```
32
32
33
-
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v2.x.x`
33
+
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v3.x.x`
34
34
35
35
### Action inputs
36
36
37
-
All inputs are **optional**. If not set, sensible default values will be used.
37
+
All inputs are **optional**. If not set, sensible defaults will be used.
38
38
39
39
**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](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs) for workarounds.
40
40
41
41
| Name | Description | Default |
42
42
| --- | --- | --- |
43
-
| `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
+
| `token` | `GITHUB_TOKEN` or a `repo` scoped [Personal Access Token (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). | `GITHUB_TOKEN` |
44
44
| `path` | Relative path under `GITHUB_WORKSPACE` to the repository. | `GITHUB_WORKSPACE` |
45
45
| `commit-message` | The message to use when committing changes. | `[create-pull-request] automated change` |
46
-
| `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. |
47
-
| `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. |
46
+
| `committer` | The committer name and email address in the format `Display Name <[email protected]>`. Defaults to the GitHub Actions bot user. | `GitHub <[email protected]>` |
47
+
| `author` | The author name and email address in the format `Display Name <[email protected]>`. Defaults to the user who triggered the workflow run. | `${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>` |
| `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. | |
50
+
| `base` | Sets the pull request base branch. | Defaults to the branch checked out in the workflow. |
51
+
| `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](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork) for details. | |
48
52
| `title` | The title of the pull request. | `Changes by create-pull-request action` |
49
53
| `body` | The body of the pull request. | `Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action` |
50
-
| `labels` | A comma separated list of labels. | |
51
-
| `assignees` | A comma separated list of assignees (GitHub usernames). | |
52
-
| `reviewers` | A comma separated list of reviewers (GitHub usernames) to request a review from. | |
53
-
| `team-reviewers` | A comma separated list of GitHub teams to request a review from. A `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) may be required. See [this issue](https://github.com/peter-evans/create-pull-request/issues/155). | |
54
+
| `labels` | A comma or newline separated list of labels. | |
55
+
| `assignees` | A comma or newline separated list of assignees (GitHub usernames). | |
56
+
| `reviewers` | A comma or newline separated list of reviewers (GitHub usernames) to request a review from. | |
57
+
| `team-reviewers` | A comma or newline separated list of GitHub teams to request a review from. Note that a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) may be required. See [this issue](https://github.com/peter-evans/create-pull-request/issues/155). | |
54
58
| `milestone` | The number of the milestone to associate this pull request with. | |
55
-
| `project` | *Deprecated*. See [Create a project card](#create-a-project-card) for details. | |
56
-
| `project-column` | *Deprecated*. See [Create a project card](#create-a-project-card) for details. | |
| `branch` | The branch name. See [Action behaviour](#action-behaviour) for details. | `create-pull-request/patch` |
59
-
| `request-to-parent` | Create the pull request in the parent repository of the checked out fork. See [push pull request branches to a fork](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork) for details. | `false` |
60
-
| `base` | Sets the pull request base branch. | Defaults to the branch checked out in the workflow. |
61
-
| `branch-suffix` | The branch suffix type. Valid values are `random`, `timestamp` and `short-commit-hash`. See [Action behaviour](#action-behaviour) for details. | |
62
60
63
61
### Action outputs
64
62
65
-
The pull request number is output as both an environment variable and a step output.
63
+
The pull request number is output as a step output.
66
64
Note that in order to read the step output the action step must have an id.
67
65
68
66
```yml
69
67
- name: Create Pull Request
70
68
id: cpr
71
-
uses: peter-evans/create-pull-request@v2
69
+
uses: peter-evans/create-pull-request@v3
72
70
- name: Check outputs
73
71
run: |
74
-
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
75
72
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
76
73
```
77
74
@@ -103,8 +100,8 @@ For further details about how the action works and usage guidelines, see [Concep
103
100
104
101
#### Alternative strategy - Always create a new pull request branch
105
102
106
-
For some use cases it *may* be desirable to always create a new unique branch each time there are changes to be committed.
107
-
This strategy is not recommended and mainly kept for backwards compatibility.
103
+
For some use cases it may be desirable to always create a new unique branch each time there are changes to be committed.
104
+
This strategy is *not recommended* because if not used carefully it could result in multiple pull requests being created unnecessarily. If in doubt, use the [default strategy](#action-behaviour) of creating an updating a fixed-name branch.
108
105
109
106
To use this strategy, set input `branch-suffix` with one of the following options.
110
107
@@ -114,23 +111,6 @@ To use this strategy, set input `branch-suffix` with one of the following option
114
111
115
112
- `short-commit-hash`- Commits will be made to a branch suffixed with the short SHA1 commit hash. e.g. `create-pull-request/patch-fcdfb59`, `create-pull-request/patch-394710b`
116
113
117
-
### Ignoring files
118
-
119
-
If there are files or directories you want to ignore you can simply add them to a `.gitignore` file at the root of your repository. The action will respect this file.
120
-
121
-
### Committer and author
122
-
123
-
If neither `committer` or `author` inputs are supplied the action will default to making commits that appear to be made by the GitHub Actions bot user.
124
-
125
-
The following configuration can be used to have commits authored by the user who triggered the workflow event.
As well as relying on the action to handle uncommitted changes, you can additionally make your own commits before the action runs.
@@ -150,17 +130,21 @@ As well as relying on the action to handle uncommitted changes, you can addition
150
130
- name: Uncommitted change
151
131
run: date +%s > report.txt
152
132
- name: Create Pull Request
153
-
uses: peter-evans/create-pull-request@v2
133
+
uses: peter-evans/create-pull-request@v3
154
134
```
155
135
136
+
### Ignoring files
137
+
138
+
If there are files or directories you want to ignore you can simply add them to a `.gitignore` file at the root of your repository. The action will respect this file.
139
+
156
140
### Create a project card
157
141
158
142
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