Skip to content

Commit

Permalink
chore(conventional-commits-workflow): get PR title from env var (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswanson-dfinity authored May 6, 2024
1 parent ed2d34f commit 4ab1172
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ jobs:
# 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 [[ "${{ github.event.pull_request.title }}" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then
- env:
TITLE: ${{ github.event.pull_request.title }}
run: |
echo "PR title: $TITLE"
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"
echo "PR title: ${{ github.event.pull_request.title }}"
exit 1
fi

0 comments on commit 4ab1172

Please sign in to comment.