Skip to content

Commit

Permalink
Validate pr title for traceability markers (infra) (#732)
Browse files Browse the repository at this point in the history
* Validate pr title for traceability markers

* Better output for the test job and compulsory brackets

Minor: removed grep output
  • Loading branch information
Hook25 authored Sep 18, 2023
1 parent 723347a commit 433f219
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pr_validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Validation
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
- edited
jobs:
validate_title:
runs-on: ubuntu-latest
steps:
- name: Checking the presence of the Traceability Marker in the PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if echo "$PR_TITLE" | grep -iqP "\((infra|bugfix|new|breaking)\)$"; then
echo "PR title contains the traceability marker"
exit 0
else
echo "Traceability marker missing"
echo "Update your title with one of the following postfix"
echo "(Infra,Bugfix,New,Breaking)"
echo
echo "e.g. $PR_TITLE (BugFix)"
exit 1
fi

0 comments on commit 433f219

Please sign in to comment.