Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
pull_request:
types: [opened, edited, synchronize, reopened]

permissions:
contents: read
Expand All @@ -16,6 +17,27 @@ env:
TEST_TAG_WORKER: user/worker:test

jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: actions/checkout@v4

- name: Check PR title for ticket number
run: |
echo "PR Title: ${{ github.event.pull_request.title }}"

# Regex pattern for a ticket number
TICKET_PATTERN="DXTA-[0-9]+" # Matches strings like DXTA-123

# Check if PR title matches the pattern
if [[ ! "${{ github.event.pull_request.title }}" =~ $TICKET_PATTERN ]]; then
echo "Error: PR title does not contain a valid ticket number!"
exit 1 # Fail the CI/CD pipeline
fi

echo "PR title contains a valid ticket number."

test:
runs-on: ubuntu-latest
steps:
Expand Down
Loading