-
Notifications
You must be signed in to change notification settings - Fork 23
42 lines (36 loc) · 1.34 KB
/
Copy pathcommitlint.yml
File metadata and controls
42 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Commitlint
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
commitlint:
# Deliberately ungated. This previously carried
# `if: vars.CLODEX_PUBLISH_ENABLED == 'true'` to stay inert in relay-ai before
# the migration to a dedicated repo. That gate silently broke the check for the
# contributors who need it most: repository variables do not resolve for
# `pull_request` runs from a fork, so `vars.CLODEX_PUBLISH_ENABLED` was empty
# there and the job reported "skipped" — a green check that never ran. Linting
# commit messages publishes nothing, so there is nothing to gate.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '24'
- run: corepack enable
- run: pnpm install --frozen-lockfile
- name: Lint commit messages
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
if [[ -z "$BASE_SHA" || "$BASE_SHA" =~ ^0+$ ]]; then
BASE_SHA="$(git rev-list --max-parents=0 "$HEAD_SHA")"
fi
pnpm exec commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose