Checks for required PR label, adds comment and fails PR checks if none of the required labels are provided
After a PR is opened
, labeled
, unlabeled
or synchronize
, below comment is added if no required labels are found in a PR
Example:
Example PRs:
- yashhy/pr-label-comment-test#1 - Fail
- yashhy/pr-label-comment-test#2 - Success
- 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 💪🏻
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}}'
npm i
npm i -g @vercel/ncc
ncc build index.js
- This op file in
dist/index.js
- Push all the files
- Create a release from GitHub