Skip to content

chore(deps): lock file maintenance (#627) #122

chore(deps): lock file maintenance (#627)

chore(deps): lock file maintenance (#627) #122

name: Conventional Commit
on:
workflow_dispatch:
push:
branches: [main, 'release/v*', next, next-major, beta, alpha]
pull_request:
branches: [main, 'release/v*', next, next-major, beta, alpha]
permissions: {}
jobs:
commit-check:
name: Commit check
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: read
env:
COMMITLINT_CONFIG_FILE: ${{ github.workspace }}/.github/commitlint.config.js
steps:
- name: Harden runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
api.github.com:443
registry.npmjs.org:443
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
fetch-depth: 0 # Required by commitlint
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: lts/iron
cache: npm
cache-dependency-path: .github/package-lock.json
- name: Install commitlint
working-directory: .github/
run: npm clean-install
- name: Validate current commit (last commit) with commitlint
if: ${{ github.event_name != 'pull_request' }}
working-directory: .github/
run: npx --no-install commitlint --config "${COMMITLINT_CONFIG_FILE}" --verbose --from HEAD~1 --to HEAD
- name: Validate PR commits with commitlint
if: ${{ github.event_name == 'pull_request' }}
working-directory: .github/
run: |
npx --no-install commitlint --config "${COMMITLINT_CONFIG_FILE}" --verbose \
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} \
--to ${{ github.event.pull_request.head.sha }}