-
-
Notifications
You must be signed in to change notification settings - Fork 195
31 lines (25 loc) · 883 Bytes
/
pr.yml
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
name: 🦄 PR
on: [ pull_request ]
jobs:
commitlint:
name: Validate title
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.7.5
- name: Fetch config package version
id: config-package-version
env:
GITMOJI_CONFIG_PACKAGE: "commitlint-config-gitmoji"
run: |
echo "CONFIG_PACKAGE=$(grep -A 2 "$GITMOJI_CONFIG_PACKAGE" pnpm-lock.yaml | awk '/version:/ {print "'"$GITMOJI_CONFIG_PACKAGE"'@" $2}')" >> $GITHUB_OUTPUT
- name: Install config package
env:
CONFIG_PACKAGE: "${{ steps.config-package-version.outputs.CONFIG_PACKAGE }}"
run: |
pnpm add -g $CONFIG_PACKAGE
- name: Validate PR title
run: |
echo "${{ github.event.pull_request.title }}" | pnpm -s dlx commitlint