-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
antazoey
committed
Jan 27, 2025
1 parent
1d91d8e
commit f12fdb9
Showing
1 changed file
with
27 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
on: push | ||
name: Validate PR metadata | ||
|
||
name: Commit Message | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
# NOTE: Skip check on PR so as not to confuse contributors | ||
# NOTE: Also install a PR title checker so we don't mess up merges | ||
jobs: | ||
commit-msg: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
permissions: | ||
pull-requests: read | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r cz-requirement.txt | ||
- name: Get base and head commits | ||
id: commits | ||
run: | | ||
echo "BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} HEAD)" >> $GITHUB_ENV | ||
echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
- name: Check commit history | ||
run: cz check --rev-range $BASE_SHA..$HEAD_SHA | ||
jobs: | ||
validate-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
name: Run conventional commit checker | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
with: | ||
types: | | ||
feat | ||
perf | ||
fix | ||
chore | ||
refactor | ||
docs | ||
test |