-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (38 loc) · 1.43 KB
/
git-commit-checks.yaml
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
name: GitHub Action CI
# We're using pull_request_target here instead of just pull_request so that the
# action runs in the context of the base of the pull request, rather than in the
# context of the merge commit. For more detail about the differences, see:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
on:
pull_request_target:
# We don't need this to be run on all types of PR behavior
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
types:
- opened
- synchronize
- edited
permissions: {} # none
jobs:
ci:
permissions:
pull-requests: write
name: Git commit checker
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
with:
# Get all branches and history
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Get the GitPython and PyGithub modules
run: pip install gitpython PyGithub
- name: Check all git commits
run:
$GITHUB_WORKSPACE/.github/workflows/git-commit-checks.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUM: ${{ github.event.number }}