Visitar URL original
Merge main into releases/v4 by github-actions[bot] · Pull Request #4257 · github/codeql-action · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ba79a4f
Do not run `pr-checks` for all push events
mbg Oct 9, 2026
2883b5b
Fix conditions in `pr-checks` workflow
mbg Oct 9, 2026
a6ff2ad
Use `github.actor` for `post-repo-size-comment` condition
mbg Oct 9, 2026
0735d79
Improve `GitHubApiDetails` types and documentation
mbg Oct 13, 2026
102e46e
Move some definitions out of `util.ts` into a new `github.ts` module
mbg Oct 13, 2026
61bfcff
Add functions to get the current and dotcom instance
mbg Oct 13, 2026
e062530
Move `GitHubApiDetails` to `github.ts`
mbg Oct 13, 2026
a243813
Make `auth` property on `GitHubApiDetails` optional
mbg Oct 13, 2026
96501a3
Use `getCurrentInstance()`
mbg Oct 13, 2026
1b0a617
Make `externalRepoAuth` check more consistent
mbg Oct 13, 2026
1d30a84
Guard against blank `auth` value
mbg Oct 13, 2026
66c96fd
Check `auth` value in `getAuthorizationHeaderFor`
mbg Oct 14, 2026
f9b4185
Check token value in `uploadBundledDatabase`
mbg Oct 14, 2026
bfe264b
Add very basic `getApiClientWithExternalAuth` test
mbg Oct 14, 2026
a08b587
Allow `getApiClient` to accept `GitHubApiDetails`
mbg Oct 14, 2026
f6e8dce
Pass `apiDetails` to `getApiClient` in `uploadBundledDatabase`
mbg Oct 14, 2026
047c751
Add a test for `uploadBundledDatabase`
mbg Oct 14, 2026
c164184
Remove explicit `authorization` header from `uploadBundledDatabase`
mbg Oct 14, 2026
8844fb3
Bump the actions-minor group across 1 directory with 3 updates
dependabot[bot] Oct 14, 2026
3afe9c0
Rebuild
github-actions[bot] Oct 14, 2026
d63cb97
Merge branch 'main' into mbg/ci/improve-pr-checks-triggers
mbg Oct 15, 2026
3ec43ab
Merge branch 'main' into dependabot/github_actions/dot-github/workflo…
mbg Oct 15, 2026
e5b217a
Merge pull request #4238 from github/dependabot/github_actions/dot-gi…
mbg Oct 15, 2026
2edace4
Update changelog and version after v4.39.0
github-actions[bot] Oct 15, 2026
46d3daa
Rebuild
github-actions[bot] Oct 15, 2026
7a6e2f7
Merge pull request #4240 from github/mergeback/v4.39.0-to-main-6f2ac81f
mbg Oct 15, 2026
1ec6b03
Enable toolcache bundle cleanup by default
henrymercer Oct 15, 2026
4ebc48b
Remove the toolcache cleanup test override
henrymercer Oct 15, 2026
0a458f1
Merge pull request #4230 from github/mbg/auth/allow-unauthed
mbg Oct 16, 2026
ae098fa
Merge pull request #4242 from github/henrymercer/graduate-toolcache-c…
henrymercer Oct 16, 2026
e038b67
Graduate overlay TRAP caching defaults
henrymercer Oct 15, 2026
0d2baf6
Update `copilot-instructions.md` to mention feature flags
mbg Oct 16, 2026
e344c79
Document TRAP caching default with improved incremental analysis
henrymercer Oct 16, 2026
2441e6e
Update "Review instructions" based on recent reviews
mbg Oct 16, 2026
f3c93e3
Add some guidelines for change notes
mbg Oct 16, 2026
6992155
Elaborate GHES details
mbg Oct 16, 2026
e461913
Drop "requests" again
mbg Oct 16, 2026
5ecf3b3
Suggest "Minor" prefix
mbg Oct 16, 2026
83e1837
Merge pull request #4247 from github/mbg/copilot/clarify-feature-flags
mbg Oct 16, 2026
604377f
Move inline script from `diagnostics-export.yml` to a `.ts` file
mbg Oct 16, 2026
3db7caf
Merge pull request #4219 from github/mbg/ci/improve-pr-checks-triggers
mbg Oct 16, 2026
0fda7a6
Merge pull request #4248 from github/mbg/move-diag-export-script
mbg Oct 20, 2026
be1223f
Log when we didn't get a normal configuration file
mbg Oct 12, 2026
a9cd2f9
Allow to explicitly not skip the SARIF upload
mbg Oct 15, 2026
6e9aec6
Add and use `shouldSkipGenerateFailedSarif`
mbg Oct 15, 2026
02fb8cc
Propagate `Config` to `combineSarifFilesUsingCLI`
mbg Oct 15, 2026
e7340ee
Skip waiting for SARIF if nothing was uploaded
mbg Oct 16, 2026
1d373e0
Upload failed SARIF as workflow artifact in test mode
mbg Oct 12, 2026
5b69b28
Improve logging in `uploadSarifArtifact`
mbg Oct 16, 2026
950b147
Ensure that `rootDirectory` is suitable for `sarifFile` in `uploadSar…
mbg Oct 16, 2026
72cb698
Update default bundle to codeql-bundle-v2.27.3
github-actions[bot] Oct 20, 2026
260a534
Add changelog note
github-actions[bot] Oct 20, 2026
74ddcd9
Fix typo in comment
mbg Oct 20, 2026
a69c7cb
Document that setting the env vars to `false` takes precedence
mbg Oct 20, 2026
7fa4518
Use `shouldSkipSarifUpload` in `analyze-action.ts`
mbg Oct 20, 2026
b96e339
Change comment for `getConfig` call in `upload-sarif`
mbg Oct 20, 2026
3dd33f8
Merge pull request #4249 from github/mbg/upload-improvements-for-4223
mbg Oct 20, 2026
61a5a80
Merge pull request #4256 from github/update-bundle/codeql-bundle-v2.27.3
mario-campos Oct 20, 2026
c5a2f4b
Merge pull request #4245 from github/henrymercer/graduate-overlay-tra…
henrymercer Oct 20, 2026
20f5ec3
Update changelog for v4.39.1
github-actions[bot] Oct 21, 2026
b5e1ed9
Trigger workflows
mario-campos Oct 21, 2026
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
Prev Previous commit
Next Next commit
Add functions to get the current and dotcom instance
  • Loading branch information
mbg committed Oct 14, 2026
commit 61bfcffab940433010be7ea4a590ab7b79af33fc
44 changes: 43 additions & 1 deletion src/github.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import test from "ava";

import { ActionsEnvVars } from "./environment";
import * as github from "./github";
import { setupTests } from "./testing-utils";
import { getTestEnv, setupTests } from "./testing-utils";

setupTests(test);

Expand Down Expand Up @@ -67,3 +68,44 @@ test("parseGitHubUrl", (t) => {
message: '"http:///::::433" is not a valid URL',
});
});

test("getCurrentInstance throws if required env vars aren't set", (t) => {
t.throws(() => github.getCurrentInstance(getTestEnv()));
t.throws(() => {
const env = getTestEnv({
[ActionsEnvVars.GITHUB_SERVER_URL]: "https://localhost",
});
github.getCurrentInstance(env);
});
t.throws(() => {
const env = getTestEnv({
[ActionsEnvVars.GITHUB_API_URL]: "https://api.localhost",
});
github.getCurrentInstance(env);
});
});

test("getCurrentInstance constructs instance from environment", (t) => {
const url = "https://localhost";
const apiUrl = "https://api.localhost";

const env = getTestEnv({
[ActionsEnvVars.GITHUB_SERVER_URL]: url,
[ActionsEnvVars.GITHUB_API_URL]: apiUrl,
});
const instance = github.getCurrentInstance(env);

t.is(instance.url, url);
t.is(instance.apiURL, apiUrl);
});

test("getCurrentInstance constructs dotcom instance with dotcom env vars", (t) => {
const env = getTestEnv({
[ActionsEnvVars.GITHUB_SERVER_URL]: github.GITHUB_DOTCOM_URL,
[ActionsEnvVars.GITHUB_API_URL]: github.GITHUB_DOTCOM_API_URL,
});
const instance = github.getCurrentInstance(env);
const dotcomInstance = github.getDotcomInstance();

t.deepEqual(dotcomInstance, instance);
});
16 changes: 16 additions & 0 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,19 @@ export function parseGitHubUrl(inputUrl: string): string {

return url.toString();
}

/** Retrieves a {@link GitHubInstance} describing the instance we are running on. */
export function getCurrentInstance(env: ReadOnlyEnv): GitHubInstance {
return {
url: env.getRequired(ActionsEnvVars.GITHUB_SERVER_URL),
apiURL: env.getRequired(ActionsEnvVars.GITHUB_API_URL),
};
}

/** Retrieves a {@link GitHubInstance} describing the GitHub.com instance. */
export function getDotcomInstance(): GitHubInstance {
return {
url: GITHUB_DOTCOM_URL,
apiURL: GITHUB_DOTCOM_API_URL,
};
}