Skip to content

issue-validator

Actions
auto close issue if it does not meet the conditions
v0.4.1
Latest
Star (0)

issue validator

license test eslint CodeQL

About

This is a simple issue validator github action that checks if the issue/pr title and body are valid.

Usage

Inputs

Input Name Description Required Default Value
title Title for the issue/pr. No ''
body Body for the issue/pr. No ''
title-regex-flags Regex flags for title. Use regex by setting to "true". No 'false'
body-regex-flags Regex flags for body. Use regex by setting to "true". No 'false'
issue-type Validate for issue or pull request. Default is "issue". No 'issue'
is-auto-close Auto close issue if not meeting conditions. No 'false'
is-match If set to "true", the title and body must match the condition. If set to "false", the title and body must not match the condition. No 'true'

Outputs

Output Name Description
result Result of validation.

RegExp

If you want to use regular expressions, set title-regex-flags and body-regex-flags to "true".

issue-validator uses the RegExp object to validate the title and body, so you can use the same syntax as the RegExp object.

document: MDN web docs

Example

When created a new issue/pr with the title starting with SPAM, the issue/pr will be closed automatically.

name: issue validator
on:
  workflow_dispatch:
  issues:
    types: [opened, edited]

permissions:
  issues: write

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: Okabe-Junya/issue-validator@latest
        with:
          title: '^SPAM'
          is-auto-close: 'true'
          issue-type: 'both'
          github-token: ${{ secrets.GITHUB_TOKEN }}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Thank you for considering contributing to this project.

When contributing to this repository, please first discuss the change you wish to make via issue before making a change.

issue-validator 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.

About

auto close issue if it does not meet the conditions
v0.4.1
Latest

issue-validator 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.