Skip to content

TC-3 Update main.yml #39

TC-3 Update main.yml

TC-3 Update main.yml #39

Workflow file for this run

name: Validate Pull Request
on:
pull_request: # Trigger on pull request events
jobs:
validate:
runs-on: ubuntu-latest # Run the workflow on Ubuntu virtual machine
steps:
- uses: actions/checkout@v3 # Checkout the repository code
- name: Check PR Description
run: |
description=${{ github.event.pull_request.body }}
jira_regex="https?://[a-zA-Z0-9-.]+\.atlassian\.net/browse/[A-Z]+-\d+" # Regular expression for JIRA ticket link
if [[ -z "${{ github.event.pull_request.body }}" ]]; then
echo "❌ Pull Request description is missing. Please provide a description of your changes."
exit 1
elif [[ ! ${{ github.event.pull_request.body }} =~ $jira_regex ]]; then
echo "❌ Pull Request description must contain a link to the JIRA ticket (e.g., https://yourcompany.atlassian.net/browse/JIRA-123)"
exit 1
fi