Repository navigation
fix(ci): repair OCodeJS test and lint workflows #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7872524
5225f1c
9c2f861
c928c4b
c90d850
6f12112
41e98f1
36e15d4
fab7d99
c47307c
916d48b
e939742
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,23 @@ name: Endor Labs | |
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| namespace: | ||
| description: Endor Labs namespace to scan | ||
| required: true | ||
| default: OCodejs | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · SARIF results fail to upload When the repository is private, Grant Prompt for AI agentsIn `.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. |
||
|
|
||
| jobs: | ||
| scan: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| 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. Choose a reason for hiding this commentThe 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 agentsIn `.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. |
||
| with: | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,17 @@ | ||
| # This is a basic workflow that is manually triggered | ||
|
|
||
| name: Manual workflow | ||
|
|
||
| # Controls when the action will run. Workflow runs when manually triggered using the UI | ||
| # or API. | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| name: | ||
| description: 'Person to greet' | ||
| default: 'World' | ||
| required: true | ||
| type: string | ||
| inputs: | ||
| name: | ||
| description: 'Person to greet' | ||
| default: 'World' | ||
| description: Person to greet | ||
| default: World | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| # This workflow contains a single job called "greet" | ||
| greet: | ||
| # The type of runner that the job will run on | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # Steps represent a sequence of tasks that will be executed as part of the job | ||
| 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 }}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Pass the input through an environment variable and print it as data rather than interpolating it into the script. Prompt for AI agentsIn `.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. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,27 @@ | ||
| # This workflow executes several linters on changed files based on languages used in your code base whenever | ||
| # you push a code or open a pull request. | ||
| # | ||
| # You can adjust the behavior by modifying this file. | ||
| # For more information, see: | ||
| # https://github.com/github/super-linter | ||
| name: Lint Code Base | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| branches: ["main"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| run-lint: | ||
| name: run-lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # Full git history is needed to get a proper list of changed files within `super-linter` | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Lint Code Base | ||
| uses: github/super-linter@v4 | ||
| env: | ||
| VALIDATE_ALL_CODEBASE: false | ||
| DEFAULT_BRANCH: "main" | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Checkout | ||
| uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 | ||
| - name: Parse all workflow YAML files | ||
| run: | | ||
| ruby - <<'RUBY' | ||
| require "yaml" | ||
| Dir.glob(".github/workflows/*.{yml,yaml}").sort.each do |path| | ||
| YAML.parse_file(path) | ||
| puts "Validated #{path}" | ||
| end | ||
| RUBY |
There was a problem hiding this comment.
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