-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.62 KB
/
Copy pathcommitlint.yml
File metadata and controls
56 lines (48 loc) · 1.62 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Commitlint
on:
workflow_dispatch:
inputs:
pr_title:
description: Pull request title to lint.
required: true
type: string
base_ref:
description: Base branch to compare against.
required: false
default: main
type: string
pull_request:
branches:
- main
types: [opened, reopened, synchronize, ready_for_review, edited]
permissions:
contents: read
pull-requests: read
concurrency:
group: commitlint-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
commitlint:
name: Commitlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "24"
- name: Prepare commitlint
run: scripts/install_commitlint.sh
- name: Lint pull request title
env:
PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || inputs.pr_title }}
run: printf '%s\n' "$PR_TITLE" | "$COMMITLINT_BIN" --config "$COMMITLINT_CONFIG"
- name: Lint pull request commits
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BASE_REF: ${{ inputs.base_ref || 'main' }}
EVENT_NAME: ${{ github.event_name }}
run: scripts/lint_pr_commits.sh