You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Close Issue
v2.0.0
A GitHub action to close an issue.
- name: Close Issue
uses: peter-evans/close-issue@v2
with:
issue-number: 1
comment: Auto-closing issue
This is just an example to show one way in which this action can be used.
on:
issues:
types: [opened]
jobs:
titlePrefixCheck:
runs-on: ubuntu-latest
steps:
- if: startsWith(github.event.issue.title, 'ABC-') != 'true'
name: Close Issue
uses: peter-evans/close-issue@v2
with:
comment: |
Issue title must start with 'ABC-'.
Auto-closing this issue.
Name | Description | Default |
---|---|---|
token |
GITHUB_TOKEN or a repo scoped PAT. |
GITHUB_TOKEN |
repository |
The GitHub repository containing the issue. | Current repository |
issue-number |
The number of the issue to close. | github.event.issue.number |
comment |
A comment to make on the issue before closing. |
You can close issues in another repository by using a PAT instead of GITHUB_TOKEN
.
The user associated with the PAT must have write access to the repository.