Skip to content

Checks for required PR label, adds comment and fails PR checks if none of the required labels are provided

License

Notifications You must be signed in to change notification settings

Teladoc/pr-label-check-and-comment-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PR label check and comment

Checks for required PR label, adds comment and fails PR checks if none of the required labels are provided

What it does?

After a PR is opened, labeled, unlabeled or synchronize, below comment is added if no required labels are found in a PR

Example:

Github bot commenting to add required labels

Example PRs:

Inputs:

  • GITHUB_TOKEN : The GITHUB_TOKEN secret. You can use the default ${{secret.GITHUB_TOKEN}}
  • required_labels : List of required labels for your PRs separated by comma ","

Example: 🕷 bug, 🏆 feature, 📝 docs

Yes, emojis are supported 💪🏻

Example Usage:

Create a file .github/workflows/pr-label-check-and-comment-action.yaml with below contents :

name: Check PR required labels and comment

on:
  pull_request:
    types: [opened, labeled, unlabeled, synchronize]

jobs:
  check-pr-label-and-comment:
    runs-on: ubuntu-latest
    steps:
      - uses: yashhy/pr-label-check-and-comment-action@master
        with:
          required_labels: '🐛bug, 🎖user-story' <-- add your required labels here
          GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'

Build & Release:

  npm i

  npm i -g @vercel/ncc

  ncc build index.js
  1. This op file in dist/index.js
  2. Push all the files
  3. Create a release from GitHub

About

Checks for required PR label, adds comment and fails PR checks if none of the required labels are provided

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%