Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
Comment thread
seonghobae marked this conversation as resolved.
with:
category: "/language:${{ matrix.language }}"
25 changes: 25 additions & 0 deletions tests/unit/coverage-script-contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,29 @@ assert.doesNotMatch(
'coverage cases never recursively invoke a coverage wrapper',
);

const codeqlWorkflow = readFileSync(
new URL('../../.github/workflows/codeql.yml', import.meta.url),
'utf8',
);
const codeqlActions = [
...codeqlWorkflow.matchAll(
/uses:\s*github\/codeql-action\/(init|analyze)@([0-9a-f]{40})\s*#\s*v(\d+\.\d+\.\d+)/g,
),
].map(([, action, digest, version]) => ({ action, digest, version }));
assert.deepEqual(
codeqlActions.map(({ action }) => action).sort(),
['analyze', 'init'],
'CodeQL workflow must pin exactly the init and analyze actions covered by this contract',
);
assert.equal(
new Set(codeqlActions.map(({ version }) => version)).size,
1,
'CodeQL init and analyze must use the same released action version',
);
assert.equal(
new Set(codeqlActions.map(({ digest }) => digest)).size,
1,
'CodeQL init and analyze must use the same immutable action commit',
);

console.log('✓ coverage script contract tests passed');
Loading