RHCLOUD-44550: Add action to validate JIRA cards in titles#1156
Merged
tylercreller merged 3 commits intoproject-kessel:mainfrom Jan 28, 2026
Merged
RHCLOUD-44550: Add action to validate JIRA cards in titles#1156tylercreller merged 3 commits intoproject-kessel:mainfrom
tylercreller merged 3 commits intoproject-kessel:mainfrom
Conversation
Contributor
Reviewer's GuideAdds a GitHub Actions workflow that enforces presence of a JIRA-style ticket ID in pull request titles using a simple regex check. Sequence diagram for GitHub PR JIRA title validation workflowsequenceDiagram
actor Developer
participant GitHub
participant Workflow_jira_check
Developer->>GitHub: Open pull_request
GitHub->>Workflow_jira_check: Trigger jira-check workflow on pull_request
Workflow_jira_check->>Workflow_jira_check: Read env PR_TITLE
alt PR_TITLE matches [A-Z]+-[0-9]+
Workflow_jira_check-->>GitHub: Job succeeds (JIRA card found)
GitHub-->>Developer: PR checks pass
else PR_TITLE does not match
Workflow_jira_check-->>GitHub: Job fails (exit 1)
GitHub-->>Developer: PR checks fail with error message
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The JIRA key regex
[A-Z]+-[0-9]+is very permissive; consider anchoring it (e.g.,^RHCLOUD-[0-9]+) or otherwise constraining it so that only valid project keys and formats are accepted and you avoid accidental matches in arbitrary uppercase text. - You can scope the workflow trigger to only relevant pull request events (e.g.,
on: pull_request: types: [opened, edited, reopened, ready_for_review]) to avoid running the check on events where the title cannot change.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The JIRA key regex `[A-Z]+-[0-9]+` is very permissive; consider anchoring it (e.g., `^RHCLOUD-[0-9]+`) or otherwise constraining it so that only valid project keys and formats are accepted and you avoid accidental matches in arbitrary uppercase text.
- You can scope the workflow trigger to only relevant pull request events (e.g., `on: pull_request: types: [opened, edited, reopened, ready_for_review]`) to avoid running the check on events where the title cannot change.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
d93ab76 to
f9eaf7d
Compare
81f54f7 to
346700e
Compare
346700e to
241ed92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a naive implementation of validating JIRA cards in titles of PRs
Summary by Sourcery
CI: