Skip to content

Commit

Permalink
ci: run commitlint to check commits (#1602)
Browse files Browse the repository at this point in the history
As first step in our main "check" workflows (push, linux, mac,
windows), check all the commit messages with commitlint.

These workflows can be triggered in various ways:
pull requests, pushes, manually, or scheduled.

For (each push to) a pull request, all commits currently in the PR
branch are checked.

For a regular push, all the pushed commits are checked.

For a manual run, it seemed to check the same commits as a push (which
push ? Not sure how this works).

For a scheduled run - we'll see.
  • Loading branch information
simonmichael committed Jul 11, 2021
1 parent f7f88a4 commit e846dfa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,25 @@ jobs:
with:
fetch-depth: 0

#- name: Print debug output
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: |
# echo "$GITHUB_SHA"
# echo "$GITHUB_REF"
# echo "$GITHUB_HEAD_REF"
# echo "$GITHUB_BASE_REF"
# git log "$GITHUB_BASE_REF"..
# bin/commitlint "$GITHUB_BASE_REF"..

- name: Check commit messages
env:
BEFORE: ${{ github.event.push.before }}
# for a PR this will be: origin/master..origin/$GITHUB_HEAD_REF
# for a push it will be: $BEFORE..
run: |
bin/commitlint ${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
# things to be cached/restored:

- name: Cache stack global package db
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
with:
fetch-depth: 0

- name: Check commit messages
# for a PR this will be: master..origin/$GITHUB_HEAD_REF
# for a push it will be: master..
run: |
bin/commitlint origin/master..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
# things to be cached/restored:

- name: Cache stack global package db
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ jobs:
with:
fetch-depth: 0

- name: Check commit messages
# for a PR this will be: master..origin/$GITHUB_HEAD_REF
# for a push it will be: master..
run: |
bin/commitlint origin/master..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
# things to be cached/restored:

- name: Cache stack global package db
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ jobs:
with:
fetch-depth: 0

- name: Check commit messages
# for a PR this will be: master..origin/$GITHUB_HEAD_REF
# for a push it will be: master..
run: |
bin/commitlint origin/master..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
# things to be cached/restored:

- name: Cache stack global package db
Expand Down

0 comments on commit e846dfa

Please sign in to comment.