Repository navigation
ci: sync bun baseline refresh #8
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
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: ⚡ Reusable Tests | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| mode: | ||
| description: Test mode to run (unit or int) | ||
| required: true | ||
| type: string | ||
| secrets: | ||
| CODECOV_TOKEN: | ||
| required: false | ||
| jobs: | ||
| test: | ||
| name: ${{ inputs.mode == 'int' && 'Integration Tests' || 'Unit Tests' }} | ||
| runs-on: | ||
| - nscloud-ubuntu-22.04-amd64-4x8-with-cache | ||
| - nscloud-cache-size-50gb | ||
| - nscloud-cache-tag-atomi-nix-store-cache | ||
| steps: | ||
| - uses: AtomiCloud/actions.setup-nix@v3 | ||
| - uses: AtomiCloud/actions.cache-bun@v1 | ||
| - name: Run ${{ inputs.mode }} tests | ||
| run: nix develop .#ci -c ./scripts/ci/test-${{ inputs.mode }}.sh | ||
|
Comment on lines
+22
to
+23
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. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Inspect every caller of the reusable workflow and the exact mode values passed.
rg -n -C2 'uses:\s*\./\.github/workflows/⚡reusable-test\.yaml|mode:' .github/workflowsRepository: AtomiCloud/diene.bun-cli Length of output: 1181 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== reusable workflow ==\n'
cat -n .github/workflows/⚡reusable-test.yaml
printf '\n== test wrapper ==\n'
cat -n scripts/ci/test.shRepository: AtomiCloud/diene.bun-cli Length of output: 2753 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== workflow callers ==\n'
rg -n -C3 'uses:\s*\./\.github/workflows/⚡reusable-test\.yaml|mode:' .github/workflowsRepository: AtomiCloud/diene.bun-cli Length of output: 1439 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
import subprocess, shlex
for mode in ["unit", "unit; echo INJECTED", 'unit $(echo INJECTED)']:
cmd = f"echo nix develop .#ci -c ./scripts/ci/test-{mode}.sh"
print(f"\nMODE={mode!r}")
print("COMMAND:", cmd)
out = subprocess.check_output(["bash", "-lc", cmd], text=True)
print("OUTPUT:", out.rstrip())
PYRepository: AtomiCloud/diene.bun-cli Length of output: 922 Validate 🧰 Tools🪛 zizmor (1.26.1)[error] 23-23: code injection via template expansion (template-injection): may expand into attacker-controllable code (template-injection) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| - name: Upload ${{ inputs.mode }} coverage artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: coverage-${{ inputs.mode }} | ||
| path: coverage/${{ inputs.mode }} | ||
| if-no-files-found: warn | ||
| - name: Upload ${{ inputs.mode }} coverage to Codecov | ||
| if: always() | ||
| continue-on-error: true | ||
| uses: codecov/codecov-action@v7 | ||
| with: | ||
| files: coverage/${{ inputs.mode }}/lcov.info | ||
| flags: ${{ inputs.mode }} | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| fail_ci_if_error: false | ||
| disable_search: true | ||
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.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: AtomiCloud/diene.bun-cli
Length of output: 1638
Pass only
CODECOV_TOKENinto the reusable workflow.⚡reusable-test.yamlonly declares and uses that secret, sosecrets: inheritgives the reusable workflow broader access than it needs.🔐 Suggested fix
unit: name: Unit Tests uses: ./.github/workflows/⚡reusable-test.yaml - secrets: inherit + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: mode: unit int: name: Integration Tests uses: ./.github/workflows/⚡reusable-test.yaml - secrets: inherit + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: mode: int📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 15-20: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[warning] 11-11: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow
(secrets-inherit)
[warning] 17-17: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow
(secrets-inherit)
🤖 Prompt for AI Agents
Source: Linters/SAST tools