-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (40 loc) · 1.33 KB
/
check-general.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
32
33
34
35
36
37
38
39
40
---
name: Checks
on:
- pull_request
jobs:
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
# yamllint disable-line rule:line-length
run: commitlint --from ${{ github.event.pull_request.head.sha }}~${{ steps.get-base.outputs.commit-count }} --to ${{ github.event.pull_request.head.sha }}
required:
runs-on: ubuntu-latest
name: Required Checks
steps:
- uses: bugale/bugroup-checks@v1
with:
checks: |-
GitHub Action.*
Check.*
.*[lL]int.*
self: Required Checks