From e9a52e12f1e2047d17d229eb21a13b8e7806833a Mon Sep 17 00:00:00 2001 From: Angus Date: Mon, 23 Dec 2024 17:41:31 -0600 Subject: [PATCH] ci: fixes commitlint job Uses the pre-installed commitlint and config for the commitlint job. --- .github/workflows/ci.yml | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d91c0bd..1098a8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,26 +32,22 @@ jobs: commitlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Cache Node.js modules + id: cache-node-modules + uses: actions/cache@v4 with: - fetch-depth: 0 - - name: Install required dependencies - run: | - apt update - apt install -y sudo - sudo apt install -y git curl - curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - - sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs - - name: Print versions - run: | - git --version - node --version - npm --version - npx commitlint --version - - name: Install commitlint - run: | - npm install conventional-changelog-conventionalcommits - npm install commitlint@latest + path: node_modules + key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-modules- + + - name: Install dependencies + run: npm ci - name: Validate current commit (last commit) with commitlint if: github.event_name == 'push'