Skip to content
Merged
Show file tree
Hide file tree
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
31 changes: 24 additions & 7 deletions .github/scripts/story_link_check.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
#!/bin/bash
set -e

link="$1"
PR_BODY="$1"

story_regex="https:\/\/app.shortcut.com\/simpledotorg\/story\/[0-9]+(\/.*)?"
JIRA_KEY_REGEX='[A-Z][A-Z0-9]+-[0-9]+'

if [[ "$link" =~ $story_regex ]]; then
echo "PR description contains a valid story link."
echo "🔍 Verifying Jira reference..."

# 1. Check PR body
if [[ "$PR_BODY" =~ $JIRA_KEY_REGEX ]]; then
echo "✅ Jira key found in PR description"
exit 0
fi

# 2. Check PR title
if [[ "$GITHUB_PR_TITLE" =~ $JIRA_KEY_REGEX ]]; then
echo "✅ Jira key found in PR title"
exit 0
else
echo "PR description doesn't contain any valid story links."
exit 1
fi

# 3. Check branch name
if [[ "$GITHUB_HEAD_REF" =~ $JIRA_KEY_REGEX ]]; then
echo "✅ Jira key found in branch name"
exit 0
fi

echo "❌ No Jira issue key found."
echo "Expected something like ENG-1234 in branch name, PR title, PR description."
exit 1
7 changes: 5 additions & 2 deletions .github/workflows/ci_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ concurrency:
cancel-in-progress: true

jobs:
verify_pr_has_story_link:
verify_pr_has_jira_reference:
runs-on: [ ubuntu-latest ]
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6
- name: Verify PR description
- name: Verify PR has Jira reference
env:
GITHUB_PR_TITLE: ${{ github.event.pull_request.title }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: .github/scripts/story_link_check.sh '${{ github.event.pull_request.body }}'

verify_changelog_was_updated:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Next Release

### Internal

-Update `ci-checks.yml` & `story-link-check.sh` to verify valid jira reference

## 2026.02.02

### Internal
Expand Down
Loading