Skip to content

Commit

Permalink
More readable regex.
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr <a-p-petrosyan@yandex.ru>
  • Loading branch information
appetrosyan committed Dec 2, 2021
1 parent cd8e7b3 commit 086b787
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/iroha2-dev-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,37 @@ jobs:
check_pr_title:
runs-on: ubuntu-latest
steps:
- name: Check PR title format
- name: Check PR for Feature
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[feature] #1: Some new feature"
run: |
echo "$PR_TITLE" | grep -Eq '^\[(feature|fix|refactor)\] \#[[:digit:]]+:.+$'
|| echo "PR_TITLE" | grep -Eq
echo "$PR_TITLE" | grep -Eqi '^\[(feature|feat\.?)\] \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):.+$'
- name: Check for bugfix
if: failed()
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[fix] #1: Some new feature"
run: |
|| echo "$PR_TITLE" | grep -Eqi '^\[(bug)?fix(up)?\] \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):.+$'
- name: Check for refactor
if: failed()
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[refactor] #1: Some refactor"
run: |
|| echo "$PR_TITLE" | grep -Eqi '^\[ref(actor)?\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$'
- name: Check for CI
if: failed()
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[refactor] #1: Some refactor"
run: |
|| echo "$PR_TITLE" | grep -Eqi '^\[ci\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$'
- name: Check for Documentation
if: failed()
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[refactor] #1: Some refactor"
run: |
|| echo "$PR_TITLE" | grep -Eqi '^\[doc(s|\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$'

0 comments on commit 086b787

Please sign in to comment.