Skip to content

Add codeql workflow - #1685

Merged
dkwon17 merged 5 commits into
devfile:mainfrom
dkwon17:add-codeql
Aug 7, 2026
Merged

Add codeql workflow#1685
dkwon17 merged 5 commits into
devfile:mainfrom
dkwon17:add-codeql

Conversation

@dkwon17

@dkwon17 dkwon17 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds CodeQL PR check and weekly scan on Monday morning (7:15 UTC).

What issues does this PR fix or reference?

Part of https://github.com/ambient-code/agentready suggestions.

Is it tested? How?

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Summary by CodeRabbit

  • Chores
    • Added automated security analysis to help identify potential vulnerabilities in Go-related changes.
    • Added recurring weekly scans for ongoing security monitoring.
    • Improved analysis accuracy by incorporating project build steps.
    • Applied restricted access permissions to protect repository data during scans.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e1685f24-85ba-45a2-a0a4-98ccee7d367a

📥 Commits

Reviewing files that changed from the base of the PR and between 65e0bea and cd33a04.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/codeql.yml

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow that runs CodeQL for Go on main pushes, pull requests, and a weekly schedule. The workflow includes manual build steps and configured permissions.

Changes

CodeQL analysis workflow

Layer / File(s) Summary
Workflow triggers and permissions
.github/workflows/codeql.yml
Defines push, pull request, and weekly scheduled triggers. Configures read-only repository access, CodeQL permissions, and the Go analysis matrix.
Go setup and analysis execution
.github/workflows/codeql.yml
Checks out the repository without persisted credentials, sets up Go from go.mod, initializes CodeQL, runs manual build commands, and executes Go analysis.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: akurinnoy, btjd, ibuziuk

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a CodeQL workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/codeql.yml:
- Around line 44-45: Update the actions/checkout step in the CodeQL workflow to
set persist-credentials to false. Keep the existing checkout action version and
workflow behavior unchanged, ensuring repository-controlled make commands cannot
access a persisted authentication token.
- Around line 26-34: Update the CodeQL job’s permissions block under analyze to
explicitly include contents: read and actions: read alongside the existing
security-events: write and packages: read permissions, preserving repository
checkout access.
- Around line 52-53: Update both the github/codeql-action references in the
CodeQL workflow, including Initialize CodeQL and the corresponding analyze step,
to pin version v4.37.3 to SHA e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d6d5639-fc91-40b5-b1e3-aca81146cc9a

📥 Commits

Reviewing files that changed from the base of the PR and between 41f60d5 and ff74c76.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml

Comment thread .github/workflows/codeql.yml Outdated
Comment thread .github/workflows/codeql.yml
Comment thread .github/workflows/codeql.yml Outdated
Comment thread .github/workflows/codeql.yml Fixed
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread .github/workflows/codeql.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/codeql.yml (1)

45-46: ⚠️ Potential issue | 🟠 Major

Disable checkout credential persistence.

actions/checkout persists GITHUB_TOKEN by default, and the subsequent repository-controlled make commands can access it. No later step requires authenticated Git operations, so set persist-credentials: false.

Proposed fix
       uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+      with:
+        persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/codeql.yml around lines 45 - 46, Update the
actions/checkout step in the CodeQL workflow to set persist-credentials to
false, ensuring subsequent repository-controlled make commands cannot access the
persisted GITHUB_TOKEN.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/codeql.yml:
- Around line 26-35: Update the job-level permissions block for the analyze job
to include contents: read and actions: read alongside the existing
security-events: write and packages: read permissions, preserving the required
CodeQL access.

---

Duplicate comments:
In @.github/workflows/codeql.yml:
- Around line 45-46: Update the actions/checkout step in the CodeQL workflow to
set persist-credentials to false, ensuring subsequent repository-controlled make
commands cannot access the persisted GITHUB_TOKEN.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c5c355a-6a0a-4c44-a460-c185b533e997

📥 Commits

Reviewing files that changed from the base of the PR and between ff74c76 and b39204a.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml

Comment on lines +26 to +35
permissions:
contents: read

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Restore the CodeQL job’s repository read permissions.

The job-level permissions block overrides the top-level block, so contents: read is currently lost. This can prevent actions/checkout and CodeQL from reading the repository. Add contents: read and actions: read to the job permissions.

Proposed fix
     permissions:
+      actions: read
+      contents: read
       security-events: write
       packages: read
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/codeql.yml around lines 26 - 35, Update the job-level
permissions block for the analyze job to include contents: read and actions:
read alongside the existing security-events: write and packages: read
permissions, preserving the required CodeQL access.

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dkwon17, rohanKanojia

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tolusha

tolusha commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm che-ai-assistant — I help with your pull requests.

I check for new comments every 10m0s, so there may be a short delay before I respond.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant ok-pr-readiness — Ensure PR has validation steps
  • /che-ai-assistant check-pr-test-failures — Analyze failing CI checks, identify root causes, and suggest fixes
  • /che-ai-assistant update-che-e2e-tests — Update Eclipse Che e2e tests
  • /che-ai-assistant claude — Run a free-form instruction on this PR
  • /che-ai-assistant help — Show this help message

@openshift-ci openshift-ci Bot removed the lgtm label Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@dkwon17

dkwon17 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

/retest

1 similar comment
@dkwon17

dkwon17 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

/retest

dkwon17 added 5 commits August 6, 2026 21:33
Signed-off-by: David Kwon <dakwon@redhat.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@dkwon17
dkwon17 merged commit 20ec7ee into devfile:main Aug 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants