Skip to content
Open
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
22 changes: 22 additions & 0 deletions .github/workflows/glm-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: GLM OpenCode Review

on:
pull_request:
branches:
- main
- dev
- build-984-hardening

jobs:
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: Add an explicit least-privilege permissions block before jobs so the token passed to the external action has only required scopes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/glm-review.yml, line 10:

<comment>Add an explicit least-privilege `permissions` block before `jobs` so the token passed to the external action has only required scopes.</comment>

<file context>
@@ -0,0 +1,22 @@
+      - dev
+      - build-984-hardening
+
+jobs:
+  review:
+    runs-on: ubuntu-latest
</file context>
Fix with Cubic

review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: GLM PR Review
uses: zhipuai/opencode-github-workflow@main

Check warning on line 18 in .github/workflows/glm-review.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/glm-review.yml#L18

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Pinning actions to a branch name like '@main' allows for unverified changes to be introduced into your CI/CD pipeline. Switch from branch tagging to SHA pinning for this action to ensure build immutability and protect against supply chain attacks.

See Issue in Codacy

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: Pin the third-party action to an immutable commit SHA instead of @main to prevent unreviewed workflow code changes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/glm-review.yml, line 18:

<comment>Pin the third-party action to an immutable commit SHA instead of `@main` to prevent unreviewed workflow code changes.</comment>

<file context>
@@ -0,0 +1,22 @@
+        uses: actions/checkout@v4
+        
+      - name: GLM PR Review
+        uses: zhipuai/opencode-github-workflow@main
+        continue-on-error: true
+        env:
</file context>
Fix with Cubic

continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GLM_API_KEY: ${{ secrets.GLM_API_KEY }}
30 changes: 30 additions & 0 deletions .github/workflows/opencode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: opencode-review

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
review:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Security: Overly broad contents: write permission for a review action

The workflow grants contents: write to a third-party action whose stated purpose is PR review. A review bot should only need contents: read (to read the diff) and pull-requests: write (to post comments). Granting write access to repository contents means a compromised action could push commits or modify branches.

Suggested fix:

    permissions:
      id-token: write
-     contents: write
+     contents: read
      pull-requests: write
      issues: write

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: Reduce contents permission to read-only for this review job to follow least-privilege security.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/opencode.yml, line 12:

<comment>Reduce `contents` permission to read-only for this review job to follow least-privilege security.</comment>

<file context>
@@ -0,0 +1,30 @@
+    runs-on: ubuntu-latest
+    permissions:
+      id-token: write
+      contents: write
+      pull-requests: write
+      issues: write
</file context>
Fix with Cubic

pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: anomalyco/opencode/github@latest

Check warning on line 19 in .github/workflows/opencode.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/opencode.yml#L19

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Security: GitHub Action not pinned to SHA, supply-chain risk

The workflow uses anomalyco/opencode/github@latest which tracks a mutable tag. A compromised or force-pushed tag would execute arbitrary code in your repository context with write permissions to contents, PRs, and issues. Pin third-party actions to a full commit SHA to mitigate supply-chain attacks (see GitHub's security hardening guide).

Suggested fix:

- uses: anomalyco/opencode/github@latest
+ uses: anomalyco/opencode/github@<full-40-char-commit-sha>  # tag: vX.Y.Z

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

Comment on lines +11 to +19
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

The workflow requests excessive write permissions (contents: write, id-token: write) that are not required for a standard AI code review task. Change contents to read and remove id-token: write. Additionally, pin the 'anomalyco/opencode' action to a full-length commit SHA instead of '@latest' to prevent supply chain attacks.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: Pin third-party GitHub Actions to an immutable commit SHA instead of @latest to prevent unreviewed code changes from being executed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/opencode.yml, line 19:

<comment>Pin third-party GitHub Actions to an immutable commit SHA instead of `@latest` to prevent unreviewed code changes from being executed.</comment>

<file context>
@@ -0,0 +1,30 @@
+      - uses: actions/checkout@v4
+        with:
+          persist-credentials: false
+      - uses: anomalyco/opencode/github@latest
+        env:
+          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
</file context>
Fix with Cubic

env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
model: anthropic/claude-3-5-sonnet-latest
use_github_token: true
prompt: |
Review this pull request:
- Check for code quality issues
- Look for potential bugs
- Suggest improvements
29 changes: 29 additions & 0 deletions .github/workflows/pr-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CodiumAI PR-Agent

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- dev
- build-984-hardening
issue_comment:
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: Add event/actor guards for issue_comment before running secret-bearing steps (for example, only PR comments from trusted associations).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/pr-agent.yml, line 10:

<comment>Add event/actor guards for `issue_comment` before running secret-bearing steps (for example, only PR comments from trusted associations).</comment>

<file context>
@@ -0,0 +1,29 @@
+      - main
+      - dev
+      - build-984-hardening
+  issue_comment:
+    types: [created]
+
</file context>
Fix with Cubic

types: [created]

jobs:
review:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: CodiumAI PR-Agent
uses: The-PR-Agent/pr-agent@main

Check warning on line 25 in .github/workflows/pr-agent.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/pr-agent.yml#L25

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
Comment on lines +19 to +25
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Reducing the contents permission to read limits the potential impact of a compromised action. Also, identify the current commit SHA for 'The-PR-Agent/pr-agent' and replace '@main' with it to ensure stability.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: Pin third-party GitHub Actions to an immutable commit SHA instead of a mutable branch (@main).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/pr-agent.yml, line 25:

<comment>Pin third-party GitHub Actions to an immutable commit SHA instead of a mutable branch (`@main`).</comment>

<file context>
@@ -0,0 +1,29 @@
+        uses: actions/checkout@v4
+        
+      - name: CodiumAI PR-Agent
+        uses: The-PR-Agent/pr-agent@main
+        continue-on-error: true
+        env:
</file context>
Fix with Cubic

continue-on-error: true
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/qwen-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Qwen Code Review

on:
pull_request:
branches:
- main
- dev
- build-984-hardening

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Qwen PR Review
uses: QwenLM/qwen-code-issue-and-pr-automation@main

Check warning on line 18 in .github/workflows/qwen-review.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/qwen-review.yml#L18

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Using the '@main' branch for GitHub Actions makes your pipeline susceptible to breaking changes or security vulnerabilities. Update the 'uses' field to use a fixed commit SHA instead of '@main'.

See Issue in Codacy

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: Pin this third-party GitHub Action to an immutable commit SHA instead of @main to prevent silent supply-chain drift.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/qwen-review.yml, line 18:

<comment>Pin this third-party GitHub Action to an immutable commit SHA instead of `@main` to prevent silent supply-chain drift.</comment>

<file context>
@@ -0,0 +1,22 @@
+        uses: actions/checkout@v4
+        
+      - name: Qwen PR Review
+        uses: QwenLM/qwen-code-issue-and-pr-automation@main
+        continue-on-error: true
+        env:
</file context>
Fix with Cubic

continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
QWEN_TOKEN: ${{ secrets.QWEN_TOKEN }}
13 changes: 13 additions & 0 deletions .pr_agent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[pr_reviewer]
extra_instructions = """
STRICT RULE: C# string literals must be ASCII-only. Flag any Unicode, emojis, or curly quotes.
STRICT RULE: The `lock(stateLock)` pattern is BANNED. Ensure all state mutations use the Enqueue/FSM model.
STRICT RULE: Verify that any order replacement uses the two-phase Replace FSM pattern.
"""

[pr_code_suggestions]
extra_instructions = """
STRICT RULE: C# string literals must be ASCII-only. Flag any Unicode, emojis, or curly quotes.
STRICT RULE: The `lock(stateLock)` pattern is BANNED. Ensure all state mutations use the Enqueue/FSM model.
STRICT RULE: Verify that any order replacement uses the two-phase Replace FSM pattern.
"""
1 change: 0 additions & 1 deletion AntigravityMobile
Submodule AntigravityMobile deleted from 3ac39e
Loading
Loading