GitHub Action
PR Linter
1.0.1
Latest version
Lint PR before merging. Usefull for generating automatic changelog and release notes with github-release-notes
Create .github/workflows/lint-pr.yml
containing:
name: Lint PR
on:
pull_request:
types: [labeled, unlabeled, opened, edited]
jobs:
lint-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ secrets.GITHUB_REF }}
- uses: yogevbd/pr-lint-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Add pr-lint.config.js
file to your main folder:
module.exports = {
validLabels: [
"bug",
"skip-changelog",
"enhancement",
"feature"
],
mandatorySections: [
{
beginsWith: "Changelog",
endsWith: "End of changelog",
message: "Changelog section is mandatory",
validate: (section) => {
return true;
}
}
]
}