Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CodeQL
on:
push:
branches: [main]
paths: ['src/**', 'scripts/**', 'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.github/workflows/codeql.yml']
paths: ['src/**', 'scripts/**', 'test/**', 'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.github/workflows/codeql.yml']
pull_request:
paths: ['src/**', 'scripts/**', 'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.github/workflows/codeql.yml']
paths: ['src/**', 'scripts/**', 'test/**', 'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', '.github/workflows/codeql.yml']
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -35,4 +35,5 @@ jobs:
paths:
- src
- scripts
- test
- uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
4 changes: 4 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ gh attestation verify setup-zig-v1.0.0.tar.gz -R ekkolon/setup-zig \

The release also provides `sbom.cdx.json` and `SHA256SUMS`. The `v1` major tag intentionally moves to compatible releases; pin a full action commit SHA or an immutable version tag when evaluating a fixed dependency. Attestations identify the publishing workflow and artifacts, but do not certify that the code is vulnerability-free or compliant with a particular standard.

## Code scanning

CodeQL analyzes maintained source in `src/`, `scripts/`, and `test/`. The generated `dist/` bundles include third-party libraries; CI checks that they reproduce from the lockfile and audits dependencies, including build tools. Review findings in bundled code against their upstream context before treating them as vulnerabilities.

## Runner and cache trust

GitHub's normal cache access rules apply. Build caches contain unsigned compiler output and packages, so treat them as workflow data. Use `cache: false` for jobs that must rebuild without restored build data. `cache-read-only` prevents this action from uploading caches; it does not make restored data trusted.
Expand Down
18 changes: 18 additions & 0 deletions test/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,21 @@ test('releases require immutability and attest their archive and SBOM', async ()
assert.ok(immutabilityCheck > publishScript.indexOf('gh release create'));
assert.ok(immutabilityCheck < publishScript.indexOf('major='));
});

test('CodeQL checks maintained source rather than generated bundles', async () => {
const workflow = parse(
await readFile('.github/workflows/codeql.yml', 'utf8'),
);
const steps = workflow.jobs.analyze.steps;
const init = steps.find((step: {uses?: string}) =>
step.uses?.startsWith('github/codeql-action/init@'),
);
const config = parse(init.with.config);
assert.deepEqual(config.paths, ['src', 'scripts', 'test']);
assert.ok(!config.paths.includes('dist'));
assert.ok(
steps.some((step: {uses?: string}) =>
step.uses?.startsWith('github/codeql-action/analyze@'),
),
);
});
Loading