-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.56 KB
/
commit_check.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Commit Check
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
commit-check-python:
name: Commit Check (Python)
runs-on: ubuntu-latest
container: python:alpine
steps:
- name: Update environment
run: |
apk update
apk add --no-cache git less openssh
- name: Checkout (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Shallow fetch (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
run: |
git config --global --add safe.directory `pwd`
git fetch --progress --shallow-exclude ${{ github.base_ref }} origin +${{ github.sha }}:refs/remotes/origin/${{ github.head_ref }}
git log --pretty=oneline
- name: Checkout (Push)
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v3
- name: Install gitcc
working-directory: ./python
# pip install gitcc
run: |
pip install .
- name: Check commits (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
run: |
git config --global --add safe.directory `pwd`
gitcc --validator gitcc.validation.SimpleTag history --verbose ./
- name: Check commit (Push)
if: ${{ github.event_name == 'push' }}
run: |
git config --global --add safe.directory `pwd`
gitcc --validator gitcc.validation.SimpleTag commit ./