Skip to content

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

License

Notifications You must be signed in to change notification settings

Okabe-Junya/issue-validator

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •