Skip to content

ci: establish enterprise GitHub Actions automation baseline#10

Merged
CoreyLeath-code merged 8 commits into
mainfrom
ops/enterprise-automation-20260723
Jul 24, 2026
Merged

ci: establish enterprise GitHub Actions automation baseline#10
CoreyLeath-code merged 8 commits into
mainfrom
ops/enterprise-automation-20260723

Conversation

@CoreyLeath-code

@CoreyLeath-code CoreyLeath-code commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Adds the enterprise automation baseline: stack-aware CI, security scanning, CodeQL, dependency review, caching, coverage artifacts, and GitHub Actions Dependabot updates. Existing project configuration is preserved.

Summary by CodeRabbit

  • Chores
    • Added automated weekly checks for GitHub Actions updates.
    • Added CodeQL security scanning for supported programming languages on pushes, pull requests, and a weekly schedule.
    • Added dependency review checks for pull requests, blocking changes that introduce high-severity dependency vulnerabilities.

@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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds GitHub Actions security automation: dynamic CodeQL scans for detected languages, pull-request dependency review checks, and weekly Dependabot updates for GitHub Actions.

Changes

Security automation

Layer / File(s) Summary
Dynamic language detection and CodeQL analysis
.github/workflows/codeql.yml
Triggers CodeQL on pushes, pull requests, and a weekly schedule; detects supported languages and analyzes each through a matrix.
Dependency review and update configuration
.github/workflows/dependency-review.yml, .github/dependabot.yml
Runs dependency review on pull requests with a high-severity threshold and configures weekly GitHub Actions update checks with up to 10 open requests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubEvent
  participant detect
  participant analyze
  participant CodeQLAction
  GitHubEvent->>detect: Trigger CodeQL workflow
  detect->>analyze: Emit detected language list
  analyze->>CodeQLAction: Initialize and analyze each language
Loading
🚥 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 summarizes the main change: adding a GitHub Actions automation baseline with CI and security workflows.
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
  • Commit unit tests in branch ops/enterprise-automation-20260723

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: 2

🧹 Nitpick comments (2)
.github/workflows/codeql.yml (2)

7-9: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Scope security-events: write to the analysis job.

The detection job only needs repository read access, but the workflow-level permission grants every job permission to modify code-scanning alerts. Keep contents: read at workflow scope and add security-events: write only under jobs.analyze.permissions. GitHub supports job-level permission overrides for this purpose. (docs.github.com)

Proposed permission scope
 permissions:
   contents: read
-  security-events: write

 jobs:
   analyze:
+    permissions:
+      contents: read
+      security-events: write
🤖 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 7 - 9, Move security-events: write
from the workflow-level permissions block into jobs.analyze.permissions, while
retaining contents: read at workflow scope and ensuring the analyze job
explicitly receives both permissions.

Sources: MCP tools, Linters/SAST tools


16-16: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Pin all workflow action dependencies to immutable commits.

These workflow actions use mutable version tags. Pin each reference to a full-length commit SHA and retain the release tag in a comment for Dependabot, for example @<sha> # v4. GitHub documents full-length SHA pinning as the immutable reference approach, while Dependabot continues to support commit-based action updates. (docs.github.com)

  • .github/workflows/codeql.yml#L16-L16: pin actions/checkout.
  • .github/workflows/codeql.yml#L39-L40: pin actions/checkout and github/codeql-action/init.
  • .github/workflows/codeql.yml#L45-L45: pin github/codeql-action/analyze.
  • .github/workflows/dependency-review.yml#L8-L8: pin actions/dependency-review-action.
🤖 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 at line 16, Pin every listed workflow action to
its full immutable commit SHA while retaining the current release tag in a
comment for Dependabot. Update actions/checkout and the CodeQL init and analyze
actions in .github/workflows/codeql.yml at lines 16, 39-40, and 45, plus
actions/dependency-review-action in .github/workflows/dependency-review.yml at
line 8; make no other workflow changes.

Source: MCP 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 24-27: Update the language-detection logic in the CodeQL workflow
to associate each detected language with its required build mode, retaining none
for C/C++ and using an appropriate build mode such as autobuild or manual for Go
and Java/Kotlin. Extend the matrix to include the per-language build mode and
pass it through the CodeQL initialization configuration as matrix.build-mode
instead of a single global none value.

In @.github/workflows/dependency-review.yml:
- Line 2: Update the workflow’s on trigger from the invalid pull_request mapping
to the documented array form, on: [pull_request], preserving the workflow’s pull
request trigger behavior.

---

Nitpick comments:
In @.github/workflows/codeql.yml:
- Around line 7-9: Move security-events: write from the workflow-level
permissions block into jobs.analyze.permissions, while retaining contents: read
at workflow scope and ensuring the analyze job explicitly receives both
permissions.
- Line 16: Pin every listed workflow action to its full immutable commit SHA
while retaining the current release tag in a comment for Dependabot. Update
actions/checkout and the CodeQL init and analyze actions in
.github/workflows/codeql.yml at lines 16, 39-40, and 45, plus
actions/dependency-review-action in .github/workflows/dependency-review.yml at
line 8; make no other workflow changes.
🪄 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: f615c2fe-c803-451b-93cf-484009b0a7ce

📥 Commits

Reviewing files that changed from the base of the PR and between 94db05d and 2e5ed81.

📒 Files selected for processing (3)
  • .github/dependabot.yml
  • .github/workflows/codeql.yml
  • .github/workflows/dependency-review.yml

Comment on lines +24 to +27
[ -f go.mod ] && langs="$langs go"
[ -f Cargo.toml ] && langs="$langs rust"
[ -f pom.xml ] || [ -f build.gradle ] && langs="$langs java-kotlin"
[ -n "$(find . -name '*.c' -print -quit)" ] || [ -n "$(find . -name '*.cpp' -print -quit)" ] && langs="$langs c-cpp"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
actionlint .github/workflows/codeql.yml

Repository: CoreyLeath-code/SentinelAI

Length of output: 164


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== workflow relevant sections =="
sed -n '1,120p' .github/workflows/codeql.yml

echo
echo "== codeql action versions and uses =="
rg -n "github/codeql-action|analyze|initialize|action.yml|`@v`[0-9]" .github/workflows/codeql.yml

Repository: CoreyLeath-code/SentinelAI

Length of output: 1908


🌐 Web query:

github codeql-action initialize build-mode none Go Kotlin supported build-mode values

💡 Result:

The CodeQL Action does not support the build-mode: none value for either Go or Kotlin [1][2][3]. For compiled languages like Go and Kotlin, the CodeQL Action supports the following build modes: - autobuild: The CodeQL Action attempts to automatically build the source code [4][1]. - manual: You must specify manual build steps in your workflow between the init and analyze steps to build the source code [4][1][5]. While the build-mode: none option is available for certain languages where the database can be created without building the source code (such as interpreted languages and specific compiled languages like C/C++, C#, Java, and Rust), it is explicitly unsupported for Go and Kotlin [1][2][5][3]. If you attempt to use build-mode: none for these languages, the action will fail with an error [6].

Citations:


Use a build mode per detected language.

build-mode: none blocks CodeQL build setup for Go and Java/Kotlin; with only one build-mode input for the whole matrix, repos that include those languages either fail or miss database creation. Keep none for C/C++ no-build scans, but carry a build mode alongside each detected language, such as autobuild/manual for Go and Java/Kotlin, and pass it as ${{ matrix.build-mode }}.

🤖 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 24 - 27, Update the
language-detection logic in the CodeQL workflow to associate each detected
language with its required build mode, retaining none for C/C++ and using an
appropriate build mode such as autobuild or manual for Go and Java/Kotlin.
Extend the matrix to include the per-language build mode and pass it through the
CodeQL initialization configuration as matrix.build-mode instead of a single
global none value.

Source: MCP tools

@@ -0,0 +1,9 @@
name: Dependency Review
on: {pull_request:}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
actionlint .github/workflows/dependency-review.yml

Repository: CoreyLeath-code/SentinelAI

Length of output: 461


Fix the invalid workflow trigger.

actionlint treats on: {pull_request:} as the unknown event pull_request: and will invalidate the workflow. Use the documented on: [pull_request] form.

Proposed fix
-on: {pull_request:}
+on: [pull_request]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on: {pull_request:}
on: [pull_request]
🧰 Tools
🪛 actionlint (1.7.12)

[error] 2-2: unknown Webhook event "pull_request:". see https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#webhook-events for list of all Webhook event names

(events)

🤖 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/dependency-review.yml at line 2, Update the workflow’s on
trigger from the invalid pull_request mapping to the documented array form, on:
[pull_request], preserving the workflow’s pull request trigger behavior.

Sources: MCP tools, Linters/SAST tools

@CoreyLeath-code
CoreyLeath-code merged commit 8da5671 into main Jul 24, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants