Skip to content

CI: [BIPS-28458] Automation tests workflow added #594

CI: [BIPS-28458] Automation tests workflow added

CI: [BIPS-28458] Automation tests workflow added #594

name: PR/item link check
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
contents: read
jobs:
enforce-link:
runs-on: ubuntu-latest
name: Enforce PR link to Jira
steps:
- name: Check linkage
run: |
re="[A-Za-z]+-[0-9]+"
err=0
[[ $TITLE =~ $re || $BODY =~ $re || $HEAD_REF =~ $re ]] && echo "Match found: ${BASH_REMATCH[0]}" || err=1
if (( err == 1)); then
echo "Invalid pull request: missing JIRA ID in title, body, or branch."
exit 1
fi
env:
TITLE: ${{ github.event.pull_request.title }}
BODY: ${{ github.event.pull_request.body }}
HEAD_REF: ${{ github.head_ref}}