feat: Add commit lint check workflow #4
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: Commit Message Linter | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
lint-commits: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v2 | |
- name: Debug SHA | |
run: | | |
echo "Base SHA: ${{ github.event.pull_request.base.sha }}" | |
echo "Head SHA: ${{ github.sha }}" | |
# Set up Node.js v20.17.0 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.17.0' | |
# Install dependencies | |
- name: Install dependencies | |
run: npm install | |
working-directory: ./app | |
# Run commitlint to check commit messages | |
- name: Run commitlint | |
run: | | |
npx commitlint --from=${{ github.event.pull_request.base.sha }} --to=${{ github.sha }} | |