This action checks if PR titles conform to the Contribution Guidelines ☑️
Consistent title names help maintainers organise their projects better 📚
Shows if the author has reaaaaally read the Contribution Guidelines :P
Create a config file .github/grafana-pr-title-checker-config.json
like this one below:
{
"LABEL": {
"name": "title needs formatting",
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["fix: ", "feat: "],
"regexp": "docs\\(v[0-9]\\): ",
"ignoreLabels": ["dont-check-PRs-with-this-label", "meta"]
}
}
If none of the checks pass, a label will be added to that pull request.
If at least one of them passes, the label will be removed.
This action causes CI tests to fail by default. However, if you don't want CI tests failing just because of this action, simply set alwaysPassCI
as true in the CHECKS field.
Also, adding label names to the optional ignoreLabels
field will forfeit any checks for PRs with those labels.
Create a workflow (eg: .github/workflows/pr-title-cheker.yml
see Creating a Workflow file) to utilize the pr-title-checker action with content:
name: "PR Title Checker"
on:
pull_request:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}