Skip to content

fix(ci): repair OCodeJS test and lint workflows - #58

Merged
zskbot merged 12 commits into
mainfrom
fix/ci-endorlabs-superlinter-workflows
Nov 13, 2026
Merged

zskbot merged 12 commits into
mainfrom
fix/ci-endorlabs-superlinter-workflows

Conversation

@zskbot

@zskbot zskbot commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Declare the missing Endor Labs namespace input so the manual scan receives a real value.
  • Pin Super-Linter to a reviewed commit and grant only read contents plus commit-status write permission.
  • Exclude imported upstream documentation under docs/content/ from first-party Markdown linting.
  • Remove a malformed workflow file that contains review prose instead of YAML.
  • Remove the duplicate inputs mapping from the manual greeting workflow.
  • Add regression coverage for these workflow contracts.

Evidence addressed

  • The current test suite had 74 passing tests and one failure because endorlabs.yml referenced inputs.namespace without declaring it.
  • Super-Linter reported two long lines in vendored docs/content/ and HTTP 403 while publishing commit status.
  • No package publishing or production deployment is added by this PR.

Safety

  • Changes are isolated on a branch and submitted as a PR. No secrets are read or modified.

Summary by Sourcery

Repair repository automation workflows and add regression coverage for their required configuration contracts.

Bug Fixes:

  • Repair Endor Labs manual scans by declaring the required namespace input and validating workflow configuration.

Enhancements:

  • Simplify the manual greeting workflow by removing its duplicate input declaration.
  • Replace the previous linter workflow with workflow YAML validation to avoid scanning vendored documentation.

CI:

  • Harden workflow permissions and pin action dependencies to reviewed revisions.
  • Remove the malformed workflow file and add regression coverage for workflow configuration contracts.

Tests:

  • Add regression tests for Endor Labs inputs, workflow YAML validation, and manual workflow input structure.

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
o-codejs Error Error Nov 13, 2026 3:06pm UTC
pages Ready Ready Preview Nov 13, 2026 3:06pm UTC
pages-i4ia Ready Ready Preview Nov 13, 2026 3:06pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Your organization has run out of review credits. Add credits to resume code reviews.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@sourcery-ai

sourcery-ai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Declare the Endor Labs namespace input and required permissions, and pin the checkout action to a reviewed commit so manual scans receive the intended configuration.

  • .github/workflows/endorlabs.yml L5-14, L21

Remove the malformed linter workflow that contains review prose instead of valid YAML.

  • .github/workflows/linter.yml (deleted)

Repair the manual greeting workflow by removing its duplicate inputs mapping and fixing the step structure.

  • .github/workflows/manual.yml L1-17 (5 small edits)

Replace the noisy Super-Linter workflow with a focused YAML syntax check for workflow files and grant the workflow read-only contents permission.

  • .github/workflows/super-linter.yml L1 (removed lines), L5-27

Tests

Add regression checks for the Endor Labs namespace default, focused workflow YAML validation, and the manual greeting workflow’s single inputs map.

  • tests/repository-config.test.mjs L28, L34-46

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-13T14:53:16.877706Z
We couldn’t complete this review. Comment @codex review to try again.
c90d850 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

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

Hey - I've found 7 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/manual.yml" line_range="17" />
<code_context>
     steps:
-    # Runs a single command using the runners shell
-    - name: Send greeting
-      run: echo "Hello ${{ inputs.name }}"
+      - name: Send greeting
+        run: echo "Hello ${{ inputs.name }}"
</code_context>
<issue_to_address>
**Greeting input executes shell commands**

When a user with permission to dispatch the workflow supplies shell syntax in the `name` input, the dispatcher-controlled `inputs.name` is substituted into the `run` script before the shell parses it, so shell metacharacters become commands and execute on the runner instead of being printed as a greeting.

Pass the input through an environment variable and print it as data rather than interpolating it into the script.
</issue_to_address>

### Comment 2
<location path=".github/workflows/endorlabs.yml" line_range="23" />
<code_context>
-        uses: actions/checkout@v4
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
       - name: Endor Labs dependency scan
         uses: endorlabs/github-action@b51bd06466b545f01a6ac788e3e1147695d3936c
         with:
</code_context>
<issue_to_address>
**Endor scan lacks credentials**

When the workflow is manually dispatched, the action receives a namespace but no Endor Labs API key or secret, so it cannot authenticate to run the scan and the manual workflow fails.

Pass the Endor Labs credentials to the action through repository or organization secrets.
</issue_to_address>

### Comment 3
<location path=".github/workflows/endorlabs.yml" line_range="14" />
<code_context>
+
+permissions:
+  contents: read
+  security-events: write

 jobs:
</code_context>
<issue_to_address>
**SARIF results fail to upload**

When the repository is private, `github/codeql-action/upload-sarif` cannot read the workflow-run status without `actions: read`, so the final upload step fails and the SARIF results do not reach code scanning.

Grant `actions: read` alongside the existing permissions.
</issue_to_address>

### Comment 4
<location path=".github/workflows/super-linter.yml" line_range="11" />
<code_context>
+
+permissions:
+  contents: read
+  statuses: write
+
 jobs:
</code_context>
<issue_to_address>
**Fork pull requests lack commit statuses**

When a contributor opens a pull request from a fork, `pull_request` runs from forks receive a read-only `GITHUB_TOKEN` despite `statuses: write`, so Super-Linter's attempt to publish a commit status gets HTTP 403 and CI status reporting remains broken.

Configure fork pull-request runs to provide a token that can publish commit statuses.
</issue_to_address>

### Comment 5
<location path=".github/workflows/endorlabs.yml" line_range="6-9" />
<code_context>
 on:
   workflow_dispatch:
+    inputs:
+      namespace:
+        description: Endor Labs namespace to scan
+        required: true
+        default: OCodejs
+        type: string
+
</code_context>
<issue_to_address>
**One namespace's alerts replace another's**

When two manual scans for the same ref use different namespaces and their SARIF uploads overlap or complete out of order, both manual runs upload SARIF for the same ref without specifying separate categories; the later upload replaces the code-scanning analysis, so the other namespace's findings disappear.

Assign each namespace a distinct SARIF category, or otherwise ensure only the intended namespace's analysis is uploaded for a ref.
</issue_to_address>

### Comment 6
<location path="tests/repository-config.test.mjs" line_range="36" />
<code_context>

+test("Super-Linter is pinned, least-privilege, and skips vendored upstream docs", () => {
+  const workflow = read(".github/workflows/super-linter.yml");
+  assert.ok(workflow.includes("statuses: write"), "Super-Linter needs explicit commit-status permission");
+  assert.ok(workflow.includes("github/super-linter@b807e99ddd37e444d189cfd2c2ca1274d8ae8ef1"));
+  assert.ok(workflow.includes("FILTER_REGEX_EXCLUDE:"));
</code_context>
<issue_to_address>
**Unnecessary write permissions go undetected**

When the workflow adds an unnecessary write permission while retaining `statuses: write`, the test only checks that `statuses: write` appears, so it passes even when the workflow grants broader write access than the claimed least-privilege contract allows.

Assert that the workflow permissions are limited to the required `contents: read` and `statuses: write`.

Also at `tests/repository-config.test.mjs:37`.
</issue_to_address>

### Comment 7
<location path="tests/repository-config.test.mjs" line_range="28" />
<code_context>
   const workflow = read(".github/workflows/endorlabs.yml");
   assert.match(workflow, /^on:\s*\n\s+workflow_dispatch:/m);
   assert.match(workflow, /namespace:\s*\n\s+description:/);
+  assert.match(workflow, /default:\s*OCodejs/);
   assert.match(workflow, /uses:\s*endorlabs\/github-action@/);
   assert.doesNotMatch(workflow, /if:\s*github\.event_name\s*==\s*'(?:push|pull_request)'/);
</code_context>
<issue_to_address>
**Manual scans lose the selected namespace**

When the namespace-to-action mapping is removed or changed incorrectly, the test checks the declared default and action name, but not that `inputs.namespace` is passed to the Endor action, so the manual scan runs without the selected namespace while the test stays green.

Assert that the Endor action's `namespace` input is mapped to `${{ inputs.namespace }}`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 7 findings to address first, and the workflows gain narrowly scoped ability to write commit statuses and security findings, so a faulty or misused workflow could leave misleading CI statuses or SARIF alerts. Those effects are bounded and can be corrected; reverting removes the new permissions and workflow changes.

Blocking findings: .github/workflows/manual.yml:17, .github/workflows/endorlabs.yml:23, .github/workflows/endorlabs.yml:14, .github/workflows/super-linter.yml:11, .github/workflows/endorlabs.yml:9, and 2 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

- name: Send greeting
run: echo "Hello ${{ inputs.name }}"
- name: Send greeting
run: echo "Hello ${{ inputs.name }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Greeting input executes shell commands

When a user with permission to dispatch the workflow supplies shell syntax in the name input, the dispatcher-controlled inputs.name is substituted into the run script before the shell parses it, so shell metacharacters become commands and execute on the runner instead of being printed as a greeting.

Pass the input through an environment variable and print it as data rather than interpolating it into the script.

Prompt for AI agents
In `.github/workflows/manual.yml` at line 17:

**Greeting input executes shell commands**

When a user with permission to dispatch the workflow supplies shell syntax in the `name` input, the dispatcher-controlled `inputs.name` is substituted into the `run` script before the shell parses it, so shell metacharacters become commands and execute on the runner instead of being printed as a greeting.

Pass the input through an environment variable and print it as data rather than interpolating it into the script.

uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Endor Labs dependency scan
uses: endorlabs/github-action@b51bd06466b545f01a6ac788e3e1147695d3936c

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 · Endor scan lacks credentials

When the workflow is manually dispatched, the action receives a namespace but no Endor Labs API key or secret, so it cannot authenticate to run the scan and the manual workflow fails.

Pass the Endor Labs credentials to the action through repository or organization secrets.

Prompt for AI agents
In `.github/workflows/endorlabs.yml` at line 23:

**Endor scan lacks credentials**

When the workflow is manually dispatched, the action receives a namespace but no Endor Labs API key or secret, so it cannot authenticate to run the scan and the manual workflow fails.

Pass the Endor Labs credentials to the action through repository or organization secrets.


permissions:
contents: read
security-events: 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.

🟡 Medium · SARIF results fail to upload

When the repository is private, github/codeql-action/upload-sarif cannot read the workflow-run status without actions: read, so the final upload step fails and the SARIF results do not reach code scanning.

Grant actions: read alongside the existing permissions.

Prompt for AI agents
In `.github/workflows/endorlabs.yml` at line 14:

**SARIF results fail to upload**

When the repository is private, `github/codeql-action/upload-sarif` cannot read the workflow-run status without `actions: read`, so the final upload step fails and the SARIF results do not reach code scanning.

Grant `actions: read` alongside the existing permissions.

Comment thread .github/workflows/super-linter.yml Resolved
Comment on lines +6 to +9
namespace:
description: Endor Labs namespace to scan
required: true
default: OCodejs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · One namespace's alerts replace another's

When two manual scans for the same ref use different namespaces and their SARIF uploads overlap or complete out of order, both manual runs upload SARIF for the same ref without specifying separate categories; the later upload replaces the code-scanning analysis, so the other namespace's findings disappear.

Assign each namespace a distinct SARIF category, or otherwise ensure only the intended namespace's analysis is uploaded for a ref.

Prompt for AI agents
In `.github/workflows/endorlabs.yml` at lines 6-9:

**One namespace's alerts replace another's**

When two manual scans for the same ref use different namespaces and their SARIF uploads overlap or complete out of order, both manual runs upload SARIF for the same ref without specifying separate categories; the later upload replaces the code-scanning analysis, so the other namespace's findings disappear.

Assign each namespace a distinct SARIF category, or otherwise ensure only the intended namespace's analysis is uploaded for a ref.

Comment thread tests/repository-config.test.mjs Resolved
Comment thread tests/repository-config.test.mjs Resolved
@zskbot
zskbot merged commit 17b591f into main Nov 13, 2026
20 of 28 checks passed
@zskbot
zskbot deleted the fix/ci-endorlabs-superlinter-workflows branch November 13, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant