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
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ updates:
time: "04:30"
timezone: Europe/Berlin
open-pull-requests-limit: 10
groups:
codeql-action:
patterns:
- "github/codeql-action*"

- package-ecosystem: nuget
directory: "/authority-host/windows/GitHubDeliveryAuthority"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ jobs:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
languages: javascript-typescript

- name: Autobuild
uses: github/codeql-action/autobuild@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
uses: github/codeql-action/autobuild@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9

- name: Analyze
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
category: "/language:javascript-typescript"

Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
global-json-file: global.json

- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
languages: csharp
build-mode: manual
Expand All @@ -138,6 +138,6 @@ jobs:
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

- name: Analyze
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
category: "/language:csharp"
16 changes: 16 additions & 0 deletions tests/unit/actions-usage-contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ test("superseded expensive PR workflows cancel in progress", () => {
}
});

test("CodeQL init, autobuild, and analyze stay on the same pinned SHA", () => {
const pins = [...codeql.matchAll(/github\/codeql-action\/(init|autobuild|analyze)@([0-9a-f]{40})/g)];
const byAction = { init: [], autobuild: [], analyze: [] };
for (const match of pins) byAction[match[1]].push(match[2]);
assert.ok(byAction.init.length >= 1, "missing init pin");
assert.ok(byAction.autobuild.length >= 1, "missing autobuild pin");
assert.ok(byAction.analyze.length >= 1, "missing analyze pin");
const shas = new Set(pins.map((match) => match[2]));
assert.equal(shas.size, 1, `mixed CodeQL action SHAs: ${[...shas].join(", ")}`);
});

test("Dependabot groups github/codeql-action updates", () => {
const dependabot = read(".github/dependabot.yml");
assert.match(dependabot, /package-ecosystem: github-actions[\s\S]*groups:\s*\n\s*codeql-action:\s*\n\s*patterns:\s*\n\s*- "github\/codeql-action\*"/);
});

test("CodeQL analyses are scoped from the PR base classifier and fail closed", () => {
assert.match(codeql, /node "\$\{TRUSTED_SCOPE\}" --mode codeql/);
assert.match(codeql, /git show "\$\{BASE_SHA\}:scripts\/ci-scope\.mjs"/);
Expand Down
Loading