Update README

This commit is contained in:
Peter Evans 2019-08-13 17:00:59 +09:00
parent 964fc3cdf1
commit 9efd6de49c

View file

@ -13,13 +13,19 @@ Create Pull Request action will:
2. Commit all changes to a new branch. The commit will be made using the name and email of the `HEAD` commit author.
3. Create a pull request to merge the new branch into the currently active branch executing the workflow.
Note: In general, it's not good practice to modify your repository during workflows.
This action is experimental and may not work well for repositories that have a very high frequency of commits.
## Usage
```hcl
action "Create Pull Request" {
uses = "peter-evans/create-pull-request@v1.0.0"
secrets = ["GITHUB_TOKEN"]
}
The default `GITHUB_TOKEN` does not have the access neccessary for this action to work correctly.
Create a new `repo` scoped token [here](https://github.com/settings/tokens) and pass that as a secret to the `REPO_ACCESS_TOKEN` environment variable.
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.0.0
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
```
#### Environment variables
@ -50,17 +56,15 @@ If there are files or directories you want to ignore you can simply add them to
Here is an example that sets all the environment variables.
```hcl
action "Create Pull Request" {
uses = "peter-evans/create-pull-request@v1.0.0"
secrets = ["GITHUB_TOKEN"]
env = {
PULL_REQUEST_BRANCH = "my-patches"
COMMIT_MESSAGE = "Auto-modify files by my-file-modifier-action"
PULL_REQUEST_TITLE = "Changes from my-file-modifier-action"
PULL_REQUEST_BODY = "This is an auto-generated PR with changes from my-file-modifier-action"
}
}
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v1.0.0
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
PULL_REQUEST_BRANCH: my-patches
COMMIT_MESSAGE: Auto-modify files by my-file-modifier-action
PULL_REQUEST_TITLE: Changes from my-file-modifier-action
PULL_REQUEST_BODY: This is an auto-generated PR with changes from my-file-modifier-action
```
This configuration will create pull requests that look like this: