Skip to content

Commit

Permalink
ci: add commits check to CI
Browse files Browse the repository at this point in the history
Closes bitcoindevkit#1119.
Creates `commits.yml` in `.github/workflows/` directory with a new GH Action
that has 2 jobs:

1. `signed-commits`: uses [`1Password/check-signed-commits-action`](https://github.com/1Password/check-signed-commits-action)
   to check if all commits in the PR are signed.
1. `conventional-commits`: uses [`cocogitto/cocogitto-action`](https://github.com/cocogitto/cocogitto-action)
   based on [`cocogitto`](https://crates.io/crates/cocogitto)
   to check if all commits in the PR follows the conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/),
   i.e. they are prefixed with `fix`, `refactor`, `feat` etc.
  • Loading branch information
realeinherjar committed Oct 2, 2023
1 parent 417963f commit 65373f2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check Commits

on:
pull_request:
branches: master

jobs:
signed-commits:
name: Check signed commits in PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check signed commits in PR
uses: 1Password/check-signed-commits-action@v1
conventional-commits:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# needs the full log
fetch-depth: 0
# pick the pr HEAD instead of the merge commit
ref: ${{ github.event.pull_request.head.sha }}
- name: Check conventional commits in PR
uses: cocogitto/cocogitto-action@v3

0 comments on commit 65373f2

Please sign in to comment.