Skip to content
Closed
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
20 changes: 14 additions & 6 deletions workflows/cve-fixer/.claude/commands/cve.fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -1173,12 +1173,13 @@ the fix requires additional changes beyond a version bump."
- Risk assessment table
- Links to CVE advisories
- **Jira issue references**: List the extracted Jira issue IDs as plain text WITHOUT hyperlinks
- ✅ Correct: `Resolves: RHOAIENG-17794, RHOAIENG-16619, RHOAIENG-16616`
- ❌ Wrong: `Resolves: [RHOAIENG-17794](https://redhat.atlassian.net/browse/RHOAIENG-17794)`
- ❌ Wrong: `Multiple RHOAIENG issues for CVE-2024-21538 across different release branches`
- Do NOT create markdown links for Jira issues
- Do NOT use generic descriptions - list the ACTUAL issue IDs
- Just list the issue IDs separated by commas
- ✅ Correct (plain): `Resolves: PROJ-12345`
- ✅ Correct (linked): `Resolves: [PROJ-12345](https://redhat.atlassian.net/browse/PROJ-12345)`
- ✅ Multiple issues: `Resolves: PROJ-12345, PROJ-12346` (when the same CVE has multiple tickets)
- ❌ Wrong: generic description with no IDs
- ❌ Wrong: omitting Jira IDs entirely
- Always include the actual issue IDs — the dashboard scans PR bodies to correlate
PRs with CVEs, so missing IDs break tracking
- **CREATE** the PR using GitHub CLI (with fallback to GitHub API):
```bash
# Prepare PR body
Expand Down Expand Up @@ -1241,9 +1242,16 @@ EOF
)

PR_URL=$(gh pr create \
--base <target-branch> \
--title "Security: Fix CVE-YYYY-XXXXX (<package-name>)" \
--body "$PR_BODY" \
--label "cve-fixer-automated" 2>/dev/null || \
gh pr create \
--base <target-branch> \
--title "Security: Fix CVE-YYYY-XXXXX (<package-name>)" \
--body "$PR_BODY")
# Note: --label silently fails if the label doesn't exist in the repo.
# The fallback without --label ensures PR is always created.

# Enable automerge if --automerge flag was passed and PR was created successfully
if [ "$AUTOMERGE" = "true" ] && [ -n "$PR_URL" ] && [ "$PR_URL" != "null" ]; then
Expand Down
Loading
Loading