| 1 |
# This file is automatically added by @npmcli/template-oss. Do not edit. |
| 2 |
|
| 3 |
name: Pull Request Linting |
| 4 |
|
| 5 |
on: |
| 6 |
pull_request: |
| 7 |
types: |
| 8 |
- opened |
| 9 |
- reopened |
| 10 |
- edited |
| 11 |
- synchronize |
| 12 |
|
| 13 |
jobs: |
| 14 |
check: |
| 15 |
name: Check PR Title or Commits |
| 16 |
runs-on: ubuntu-latest |
| 17 |
steps: |
| 18 |
- uses: actions/checkout@v3 |
| 19 |
with: |
| 20 |
fetch-depth: 0 |
| 21 |
- name: Setup git user |
| 22 |
run: | |
| 23 |
git config --global user.email "[email protected]" |
| 24 |
git config --global user.name "npm CLI robot" |
| 25 |
- uses: actions/setup-node@v3 |
| 26 |
with: |
| 27 |
node-version: 16.x |
| 28 |
- name: Update npm to latest |
| 29 |
run: npm i --prefer-online --no-fund --no-audit -g npm@latest |
| 30 |
- run: npm -v |
| 31 |
- name: Install deps |
| 32 |
run: npm i -D @commitlint/cli @commitlint/config-conventional |
| 33 |
- name: Check commits OR PR title |
| 34 |
env: |
| 35 |
PR_TITLE: ${{ github.event.pull_request.title }} |
| 36 |
run: | |
| 37 |
npx --offline commitlint -V --from origin/main --to ${{ github.event.pull_request.head.sha }} \ |
| 38 |
|| echo $PR_TITLE | npx --offline commitlint -V |