You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: use standard github actions workflow for codeql alert triage - #1295
This PR introduces a standard, native GitHub Actions workflow for on-demand CodeQL Alert Triage & Remediation across zopencommunity port repositories (modeled after the architecture used in community_digest.yml).
Key Capabilities
Manual / On-Demand Execution:
Maintainers can trigger triage from the GitHub Actions tab UI (workflow_dispatch) by specifying a repository (e.g. curlport) and optional alert_number.
Maintainers can also trigger triage directly in issue/PR comments using slash commands: /codeql <repo> or /analyze-codeql <repo> alert:<number>.
False Positive Evaluation & Code Context:
Uses tools/codeql_alert_triage.py to fetch open CodeQL alerts via the GitHub Code Scanning API, extract the relevant source code window (±25 lines), and assess whether findings are False Positives (e.g. bounded upstream checks, unreachable test code, or benign z/OS-specific ASCII/EBCDIC behaviors).
Automated Fix Generation:
For confirmed real vulnerabilities, generates copy-pasteable unified diff patches and z/OS-tailored remediation guidance in the GitHub Actions Job Summary and optional issue comment.
Changes Included
.github/workflows/codeql_alert_triage.yml: Standard native GitHub Actions workflow file for on-demand execution and comment triggering without requiring extra lockfiles.
Replaces the experimental .md workflow definition with standard .yml.
Related Issues
Related Issue #
Closes #
[optional] Are there any post-deployment tasks or follow-up actions required?
None. The workflow is immediately usable from the GitHub Actions tab once merged into main.
Replaces the experimental CodeQL triage definition with a native GitHub Actions workflow intended to analyze alerts and suggest remediation across zopen port repositories.
Changes:
Adds manual dispatch and /codeql or /analyze-codeql comment triggers.
Connects the existing alert collector to Copilot-based analysis, job summaries, and optional issue/PR comments.
Removes the Markdown workflow definition.
File
Description
.github/workflows/zopen-codeql-triage.md
Removes the experimental agent workflow.
.github/workflows/codeql_alert_triage.yml
Adds native workflow triggers, alert collection, AI triage, and report publishing.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The workflow risks exposing private-repository security details to unauthorized requesters, uses an unsupported Copilot CLI runtime, and has unresolved argument-parsing and report-handling defects.
This regex searches the entire comment instead of parsing the alert argument: /codeql alert123port incorrectly selects alert #123, while /analyze-codeql curlport 42, documented by the existing parser, silently ignores the requested alert number. Reuse parse_slash_command_args so repository names cannot supply the alert number and the existing numeric/#number forms remain supported.
Handle reports exceeding GitHub comment limits
.github/workflows/codeql_alert_triage.yml:142
The report can exceed GitHub's 65,536-character issue-comment limit, especially with the default 15 alerts and their source snippets. Posting an oversized report fails with HTTP 422, so the slash command never posts its result. For oversized reports, post a short link to the full workflow summary instead.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The repository visibility check fails open for a crafted --repo value, potentially exposing private code-scanning alert details in public job summaries or issue comments.
This visibility check fails open: --repo 'zopencommunity/privateport/code-scanning/alerts?state=open&ignored=' makes both API requests address the alert-list endpoint, whose list response bypasses this condition. If REPO_GITHUB_TOKEN can read that private repository, its alert details can reach the public job summary or issue comment. Before fetching alerts, require repository metadata whose full_name matches the requested repository and whose private field is explicitly false.
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
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.
What type of PR is this? (check all applicable)
Category
Description
This PR introduces a standard, native GitHub Actions workflow for on-demand CodeQL Alert Triage & Remediation across
zopencommunityport repositories (modeled after the architecture used incommunity_digest.yml).Key Capabilities
workflow_dispatch) by specifying a repository (e.g.curlport) and optionalalert_number./codeql <repo>or/analyze-codeql <repo> alert:<number>.tools/codeql_alert_triage.pyto fetch open CodeQL alerts via the GitHub Code Scanning API, extract the relevant source code window (±25 lines), and assess whether findings are False Positives (e.g. bounded upstream checks, unreachable test code, or benign z/OS-specific ASCII/EBCDIC behaviors).Changes Included
.github/workflows/codeql_alert_triage.yml: Standard native GitHub Actions workflow file for on-demand execution and comment triggering without requiring extra lockfiles..mdworkflow definition with standard.yml.Related Issues
[optional] Are there any post-deployment tasks or follow-up actions required?
None. The workflow is immediately usable from the GitHub Actions tab once merged into
main.