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 6dc92c6
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 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,45 @@ 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?)+\)):.+$'
continue-on-error: true

- name: Check for bugfix
if: ${{ failure() }}
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?)+\)):.+$'
continue-on-error: true

- name: Check for refactor
if: ${{ failure() }}
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[refactor] #1: Some refactor"
run: |
echo "$PR_TITLE" | grep -Eqi '^\[ref(actor)?\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$'
continue-on-error: true

- name: Check for CI
if: ${{ failure() }}
env:
PR_TITLE: ${{ github.event.pull_request.title }}
# Example: "[refactor] #1: Some refactor"
run: |
echo "$PR_TITLE" | grep -Eqi '^\[ci\]( \#?([[:digit:]]+|\(([[:digit:]]+,?\s?)+\)):)?.+$'
continue-on-error: true

- name: Check for Documentation
if: ${{ failure() }}
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 6dc92c6

Please sign in to comment.