Update README

This commit is contained in:
Peter Evans 2019-10-06 14:59:45 +09:00
parent 5f9821866a
commit fbe0cd3d1a

View file

@ -10,7 +10,7 @@ The changes will be automatically committed to a new branch and a pull request c
Create Pull Request action will: Create Pull Request action will:
1. Check for repository changes in the Actions workspace. This includes untracked (new) files as well as modified files. 1. Check for repository changes in the Actions workspace. This includes untracked (new) files as well as modified files.
2. Commit all changes to a new branch, or update an existing pull request branch. The commit will be made using the name and email of the `HEAD` commit author. 2. Commit all changes to a new branch, or update an existing pull request branch.
3. Create a pull request to merge the new branch into the currently active branch executing the workflow. 3. Create a pull request to merge the new branch into the currently active branch executing the workflow.
## Usage ## Usage
@ -18,7 +18,7 @@ Create Pull Request action will:
Linux Linux
```yml ```yml
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v1.5.0 uses: peter-evans/create-pull-request@v1.5.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
``` ```
@ -26,7 +26,7 @@ Linux
Multi platform - Linux, MacOS, Windows (beta) Multi platform - Linux, MacOS, Windows (beta)
```yml ```yml
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v1.5.0-multi uses: peter-evans/create-pull-request@v1.5.1-multi
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
``` ```
@ -36,18 +36,22 @@ See [this issue](https://github.com/peter-evans/create-pull-request/issues/48) f
### Environment variables ### Environment variables
These variables are all optional. If not set, a default value will be used. These variables are *all optional*. If not set, sensible default values will be used.
- `COMMIT_MESSAGE` - The message to use when committing changes. | Name | Description | Default |
- `PULL_REQUEST_TITLE` - The title of the pull request. | --- | --- | --- |
- `PULL_REQUEST_BODY` - The body of the pull request. | `COMMIT_MESSAGE` | The message to use when committing changes. | `Auto-committed changes by create-pull-request action` |
- `PULL_REQUEST_LABELS` - A comma separated list of labels. | `COMMIT_AUTHOR_EMAIL` | The email address of the commit author. | For `push` events, defaults to the HEAD commit author. Otherwise, <GITHUB_ACTOR>@users.noreply.github.com, where `GITHUB_ACTOR` is the GitHub user that initiated the event. |
- `PULL_REQUEST_ASSIGNEES` - A comma separated list of assignees (GitHub usernames). | `COMMIT_AUTHOR_NAME` | The name of the commit author. | For `push` events, defaults to the HEAD commit author. Otherwise, <GITHUB_ACTOR>, the GitHub user that initiated the event. |
- `PULL_REQUEST_REVIEWERS` - A comma separated list of reviewers (GitHub usernames) to request a review from. | `PULL_REQUEST_TITLE` | The title of the pull request. | `Auto-generated by create-pull-request action` |
- `PULL_REQUEST_TEAM_REVIEWERS` - A comma separated list of GitHub teams to request a review from. | `PULL_REQUEST_BODY` | The body of the pull request. | `Auto-generated pull request by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub Action` |
- `PULL_REQUEST_MILESTONE` - The number of the milestone to associate this pull request with. | `PULL_REQUEST_LABELS` | A comma separated list of labels. | `none` |
- `PULL_REQUEST_BRANCH` - The branch name. See **Branch naming** below for details. | `PULL_REQUEST_ASSIGNEES` | A comma separated list of assignees (GitHub usernames). | `none` |
- `BRANCH_SUFFIX` - The branch suffix type. Valid values are `short-commit-hash` (default), `timestamp`, `random` and `none`. See **Branch naming** below for details. | `PULL_REQUEST_REVIEWERS` | A comma separated list of reviewers (GitHub usernames) to request a review from. | `none` |
| `PULL_REQUEST_TEAM_REVIEWERS` | A comma separated list of GitHub teams to request a review from. | `none` |
| `PULL_REQUEST_MILESTONE` | The number of the milestone to associate this pull request with. | `none` |
| `PULL_REQUEST_BRANCH` | The branch name. See **Branch naming** below for details. | `create-pull-request/patch` |
| `BRANCH_SUFFIX` | The branch suffix type. Valid values are `short-commit-hash`, `timestamp`, `random` and `none`. See **Branch naming** below for details. | `short-commit-hash` |
Output environment variables Output environment variables
@ -98,7 +102,7 @@ jobs:
- name: Create report file - name: Create report file
run: date +%s > report.txt run: date +%s > report.txt
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v1.5.0 uses: peter-evans/create-pull-request@v1.5.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MESSAGE: Add report file COMMIT_MESSAGE: Add report file
@ -134,7 +138,7 @@ The recommended method is to use `set-output`. Note that the step where output v
echo ::set-output name=pr_body::"This PR was auto-generated on $(date +%d-%m-%Y) \ 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)." by [create-pull-request](https://github.com/peter-evans/create-pull-request)."
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v1.5.0 uses: peter-evans/create-pull-request@v1.5.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_TITLE: ${{ steps.vars.outputs.pr_title }} PULL_REQUEST_TITLE: ${{ steps.vars.outputs.pr_title }}
@ -150,7 +154,7 @@ Since the action reads environment variables from the system, it's technically n
echo ::set-env name=PULL_REQUEST_BODY::"This PR was auto-generated on $(date +%d-%m-%Y) \ 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)." by [create-pull-request](https://github.com/peter-evans/create-pull-request)."
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v1.5.0 uses: peter-evans/create-pull-request@v1.5.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
``` ```