-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (28 loc) · 1.11 KB
/
lint-pr-title.yaml
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
# The title of the pull request is used as the commit message when working with a squash-based merging style.
# This project also follows semantic versioning, so it is important that the title follows conventional commits and should therefore be checked.
name: Lint PR title
on:
pull_request:
branches:
- main
- next
- beta
- alpha
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
types: [opened, synchronize, reopened, edited]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- run: npm install -g @commitlint/config-angular
- run: echo $TITLE | npx commitlint
env:
# Security: we mitigate script injections by using an intermediate environment variable
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TITLE: ${{ github.event.pull_request.title }}