chore(ci): separate lint pr (main) (#4917)

This commit is contained in:
Radosław Szpiech 2023-09-28 14:01:36 +02:00 committed by GitHub
parent 7fe269fad6
commit e2a72cb395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 19 deletions

View File

@ -10,7 +10,6 @@ on:
- opened
- ready_for_review
- reopened
- edited
- synchronize
jobs:
node-modules:
@ -42,13 +41,6 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --pure-lockfile
lint-pr-title:
needs: node-modules
if: ${{ github.event_name == 'pull_request' }}
name: Verify PR title
uses: ./.github/workflows/lint-pr.yml
secrets: inherit
lint-format:
timeout-minutes: 20
needs: node-modules

View File

@ -2,7 +2,10 @@
name: Verify PR title
on:
workflow_call:
pull_request:
types:
- opened
- edited
jobs:
lint_pr:
@ -11,21 +14,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
cache: yarn
node-version: 16
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
run: |
rm package.json
npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx
- name: Check PR title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./commitlint.config-ci.js