Issue auto-closer
ActionsAutomatically closes issues (or pull requests) if the body doesn t match a specified regular expression
v1.2
LatestBy roots
Tags
(2)Automatically close issues or pull requests whose body text does not match the specified regular expression pattern. This is useful to enforce usage of issue/PR templates.
To configure the action simply add the following lines to your .github/main.workflow
workflow file:
name: Autocloser
on: [issues, pull_request]
jobs:
autoclose:
runs-on: ubuntu-latest
steps:
- name: Autoclose issues that did not follow issue template
uses: roots/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-close-message: "@${issue.user.login} this issue was automatically closed because it did not follow the issue template"
issue-pattern: ".*guidelines for Contributing.*"
issue-close-message
and pr-close-message
are ES6-style template literals which will be evaluated with the issue or pull request
webhook payload in context. The example above uses ${issue.user.login}
to get the author of the issue.
issue
webhook payload examplepull_request
webhook payload example
issue-pattern
and pr-pattern
are strings which are compiled to JavaScript Regexp
s.
Issue auto-closer is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.