You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Close Pull
v1.0.0
A GitHub action to close a pull request and optionally delete its branch.
- name: Close Pull
uses: peter-evans/close-pull@v1
with:
pull-request-number: 1
comment: Auto-closing pull request
delete-branch: true
on:
pull_request:
types: [opened]
jobs:
closePullRequest:
runs-on: ubuntu-latest
steps:
- name: Close Pull
uses: peter-evans/close-pull@v1
with:
comment: |
Sorry. Pull requests are not accepted for this repository.
Auto-closing this pull request.
Name | Description | Default |
---|---|---|
token |
GITHUB_TOKEN or a repo scoped PAT. |
GITHUB_TOKEN |
repository |
The GitHub repository containing the pull request. | Current repository |
pull-request-number |
The number of the pull request to close. | github.event.number |
comment |
A comment to make on the pull request before closing. | |
delete-branch |
Delete the pull request branch. | false |
Note: Deleting branches will fail silently for pull requests from forks.
You can close pull requests in another repository by using a PAT instead of GITHUB_TOKEN
.
The user associated with the PAT must have write access to the repository.