* feat: update action runtime to node 16

* feat: allow add-paths to resolve to no changes

* docs: update readme

* chore: update package lock

* chore: bump dependency

* ci: add dependabot workflow

* docs: update action versions
This commit is contained in:
Peter Evans 2022-03-23 14:22:01 +09:00 committed by GitHub
parent 0e8dfbd57d
commit d6d5519d05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 291 additions and 185 deletions

View file

@ -21,20 +21,20 @@ Create Pull Request action will:
- [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md)
- [Examples](docs/examples.md)
- [Updating to v3](docs/updating.md)
- [Updating to v4](docs/updating.md)
## Usage
```yml
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
```
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v3.x.x`
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v4.x.x`
### Action inputs
@ -46,7 +46,7 @@ All inputs are **optional**. If not set, sensible defaults will be used.
| --- | --- | --- |
| `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` |
| `path` | Relative path under `GITHUB_WORKSPACE` to the repository. | `GITHUB_WORKSPACE` |
| `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. Defaults to adding all new and modified files. See [Add specific paths](#add-specific-paths). | `-A` |
| `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). | |
| `commit-message` | The message to use when committing changes. | `[create-pull-request] automated change` |
| `committer` | The committer name and email address in the format `Display Name <email@address.com>`. Defaults to the GitHub Actions bot user. | `GitHub <noreply@github.com>` |
| `author` | The author name and email address in the format `Display Name <email@address.com>`. Defaults to the user who triggered the workflow run. | `${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>` |
@ -68,7 +68,7 @@ All inputs are **optional**. If not set, sensible defaults will be used.
For self-hosted runners behind a corporate proxy set the `https_proxy` environment variable.
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
env:
https_proxy: http://<proxy_address>:<port>
```
@ -88,7 +88,7 @@ Note that in order to read the step outputs the action step must have an id.
```yml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
@ -147,12 +147,11 @@ If there are files or directories you want to ignore you can simply add them to
You can control which files are committed with the `add-paths` input.
Paths should follow git's [pathspec](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec) syntax.
Each path must resolve to a least one new or modified file to add.
All file changes that do not match one of the paths will be discarded.
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
*.java
@ -166,7 +165,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
```yml
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Create commits
run: |
git config user.name 'Peter Evans'
@ -179,7 +178,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
- name: Uncommitted change
run: date +%s > report.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
```
### Create a project card
@ -189,11 +188,11 @@ To create a project card for the pull request, pass the `pull-request-number` st
```yml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
- name: Create or Update Project Card
if: ${{ steps.cpr.outputs.pull-request-number }}
uses: peter-evans/create-or-update-project-card@v1
uses: peter-evans/create-or-update-project-card@v2
with:
project-name: My project
column-name: My column
@ -217,14 +216,14 @@ jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Make changes to pull request
run: date +%s > report.txt
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PAT }}
commit-message: Update report