Giter Club home page Giter Club logo

issue-checker's Introduction

Issue Checker

Automatically label and comments to new issues or pull requests based on the contents.

Usage

Create .github/issue-checker.yml

Create a .github/issue-checker.yml file with a list of labels and regex to match to apply the label.

Basic Examples

# For labels
labels:
- name: label-1
  # Add `bug` label if issue contains the word `Bug` or `bug`; Remove if not
  content: bug
  regexes: '[Bb]ug'
- name: enhancement
  # Add `enhancement` label if issue match all of the regexes; Remove if not; Skip if the label `bug` have been added;
  regexes: '[Ee]nhancement|[Ff]eature [Rr]equest'
  skip-if:
  - label-1
- name: label-3
  # Add `Collaborator` label if the issue author is a COLLABORATOR.
  content: Collaborator
  author_association: COLLABORATOR
# For comments
comments:
- name: comments-1
  # Comment the content below if issue contains the word `Uploading`
  content:
    "You have some files that did not upload successfully, please re-upload them."
  regexes:
    'Uploading'

The format of the configuration file is shown below.

default-mode:          # optional
  pull_request:        # optional, choices [pull_request, pull_request_target, issues, issue_comment]
  - add                # optional, choices [add, remove]
  - ...
  ...
labels:                # optional, choices [labels, comments]
- name: string         # required
  content: string      # optional, default ${name}
  regexes:             # optional, required if ${author_association} undefined
    string[] | string
  author_association:  # optional, required if ${regexes} undefined
    string
  remove-if:           # optional
    string[] | string
  skip-if:             # optional
    string[] | string
  mode:                # optional
    pull_request:      # optional, choices [pull_request, pull_request_target, issues, issue_comment]
    - add              # optional, choices [add, remove]
    - ...
    ...
- ...
...

Create Workflow

Create a workflow (eg: .github/workflows/issue-checker.yml see Creating a Workflow file) to utilize the labeler action with content:

name: "Issue Checker"
on:
  issues:
    types: [opened, edited]
  pull_request_target:
    types: [opened, edited]
jobs:
  triage:
    permissions:
      contents: read
      issues: write
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
    - uses: zzyyyl/[email protected]
      with:
        repo-token: "${{ secrets.GITHUB_TOKEN }}"
        configuration-path: .github/issue-checker.yml
        not-before: 2022-08-01T00:00:00Z
        include-title: 0
        sync-labels: 1

Warning: Do not use triggers other than pull_request, pull_request_target, issues and issue_comment, unless you know what you are doing.

Note: This grants access to the GITHUB_TOKEN so the action can make calls to GitHub's rest API.

Inputs

Various inputs are defined in action.yml to let you configure the issue-checker:

Name Description Default
repo-token Token to use to authorize label changes. N/A
configuration-path The path to the label configuration file N/A
sync-labels Whether or not to remove labels when not match 1
include-title Whether or not the title participate in matching 0
not-before Any issues prior to this timestamp will be ignored (blank to handle all issues) N/A

issue-checker's People

Contributors

dependabot[bot] avatar zzyyyl avatar ngc7331 avatar mark9804 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.