-
Notifications
You must be signed in to change notification settings - Fork 1
29 lines (26 loc) · 1008 Bytes
/
check-commit-pr.yml
File metadata and controls
29 lines (26 loc) · 1008 Bytes
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
# This workflow checks commit messages using cocogitto's docker image.
# I decided to use a docker image rather than cocogitto's github action
# to keep things as portable as possible and to easily replicate the
# workflow locally.
name: Check commit messages and PR titles
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
check-commit-messages:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Pull cocogitto's docker image
run: docker pull ghcr.io/cocogitto/cog:latest
- name: Check commits using cocogitto
run: docker run -t -v "$GITHUB_WORKSPACE":/app/ ghcr.io/cocogitto/cog:latest check
- name: Check PR title using cocogitto
if: github.event_name == 'pull_request'
run: docker run -t ghcr.io/cocogitto/cog:latest verify "${{ github.event.pull_request.title }}"