Close Pull
A GitHub action to close a pull request and optionally delete its branch.
Usage
Close a pull request and delete its branch
- name: Close Pull
uses: peter-evans/close-pull@v2
with:
pull-request-number: 1
comment: Auto-closing pull request
delete-branch: true
Action inputs
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 to public repositories from forks. Private repositories can be configured to enable workflows from forks to run without restriction.
Accessing pull requests in other repositories
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.