From e2a72cb39501de29ad83cbe8e8efeb3108db6ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Thu, 28 Sep 2023 14:01:36 +0200 Subject: [PATCH] chore(ci): separate lint pr (main) (#4917) --- .github/workflows/ci-cd-trigger.yml | 8 -------- .github/workflows/lint-pr.yml | 20 +++++++++----------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-cd-trigger.yml b/.github/workflows/ci-cd-trigger.yml index 2fb441e24..ac5f65f8b 100644 --- a/.github/workflows/ci-cd-trigger.yml +++ b/.github/workflows/ci-cd-trigger.yml @@ -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 diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 9b1666a42..344a607ac 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -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