Repository navigation
fix(ci): repair OCodeJS test and lint workflows - #58
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Your organization has run out of review credits. Add credits to resume code reviews. |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Reviewer's GuideConfigurationDeclare the Endor Labs namespace input and required permissions, and pin the checkout action to a reviewed commit so manual scans receive the intended configuration.
Remove the malformed linter workflow that contains review prose instead of valid YAML.
Repair the manual greeting workflow by removing its duplicate inputs mapping and fixing the step structure.
Replace the noisy Super-Linter workflow with a focused YAML syntax check for workflow files and grant the workflow read-only contents permission.
TestsAdd regression checks for the Endor Labs namespace default, focused workflow YAML validation, and the manual greeting workflow’s single inputs map.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
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
| - name: Send greeting | ||
| run: echo "Hello ${{ inputs.name }}" | ||
| - name: Send greeting | ||
| run: echo "Hello ${{ inputs.name }}" |
There was a problem hiding this comment.
🟡 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 |
There was a problem hiding this comment.
🟠 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 |
There was a problem hiding this comment.
🟡 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.| namespace: | ||
| description: Endor Labs namespace to scan | ||
| required: true | ||
| default: OCodejs |
There was a problem hiding this comment.
🟡 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.
Summary
docs/content/from first-party Markdown linting.inputsmapping from the manual greeting workflow.Evidence addressed
endorlabs.ymlreferencedinputs.namespacewithout declaring it.docs/content/and HTTP 403 while publishing commit status.Safety
Summary by Sourcery
Repair repository automation workflows and add regression coverage for their required configuration contracts.
Bug Fixes:
Enhancements:
CI:
Tests: