Support more namings and subtitles #3
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: Checks | |
on: | |
- pull_request | |
jobs: | |
required: | |
name: Required Checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
checks: |- | |
Check .* | |
.*[lL]int.* | |
self: Required Checks | |
check-commits: | |
name: Check Commits | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Dependencies | |
run: npm install -g @commitlint/cli @commitlint/config-conventional conventional-changelog-conventionalcommits | |
- name: Get Base | |
id: get-base | |
run: |- | |
count=$(gh api "/repos/${{ github.repository }}/pulls/${{ github.event.number }}/commits" --jq "length") | |
req=$(($count + 1)) | |
echo "count: $count, req: $req" | |
echo "commit-count=$count" >> $GITHUB_OUTPUT | |
echo "required=$req" >> $GITHUB_OUTPUT | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: ${{ steps.get-base.outputs.required }} | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Check Commits | |
run: |- | |
commitlint --from ${{ github.event.pull_request.head.sha }}~${{ steps.get-base.outputs.commit-count }} --to ${{ github.event.pull_request.head.sha }} | |