Skip to content

Commit

Permalink
ci: conventional commit checks (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorydemay authored Oct 17, 2024
1 parent 2b8be23 commit 71f2fe7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ jobs:
run: |
hash=`sha256sum evm_rpc.wasm.gz`
echo "SHA-256 :hash: ${hash}" >> $GITHUB_STEP_SUMMARY
e2e:
runs-on: ubuntu-latest
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR title format
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# When getting Rust dependencies, retry on network error:
CARGO_NET_RETRY: 10
# Use the local .curlrc
CURL_HOME: .
TITLE: ${{ github.event.pull_request.title }}
jobs:
check:
name: conventional-pr-title:required
runs-on: ubuntu-latest
steps:
# Conventional commit patterns:
# verb: description
# verb!: description of breaking change
# verb(scope): Description of change to $scope
# verb(scope)!: Description of breaking change to $scope
# verb: feat, fix, ...
# scope: refers to the part of code being changed. E.g. " (accounts)" or " (accounts,canisters)"
# !: Indicates that the PR contains a breaking change.
- run: |
if [[ "$TITLE" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then
echo pass
else
echo "PR title does not match conventions"
exit 1
fi

0 comments on commit 71f2fe7

Please sign in to comment.