👷 chore: Validate PR titles #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
grep -A 2 "GITMOJI_CONFIG_PACKAGE" pnpm-lock.yaml \ | |
| awk '/version:/ {print "'"GITMOJI_CONFIG_PACKAGE"'@" $2}' | |
- name: Install config package | |
env: | |
CONFIG_PACKAGE: "${{ steps.config-package-version.outputs.stdout }}" | |
run: | | |
pnpm add $CONFIG_PACKAGE | |
- name: Validate PR title | |
run: | | |
echo "${{ github.event.pull_request.title }}" | pnpm -s dlx commitlint |