mirror of
https://github.com/github/codeql-action.git
synced 2026-01-03 21:20:09 +08:00
Add the feature to bypass the toolcache for kotlin and swift
This works by moving the logic to check for toolcache bypass out of creating the codeql instance. The logic now _may_ perform an API request in order to check what languages are in the repository. This check is redundant because the same call is being made later in the action when the actual list of languages is calculated.
This commit is contained in:
@@ -162,6 +162,26 @@ export function mockFeatureFlagApiEndpoint(
|
||||
sinon.stub(apiClient, "getApiClient").value(() => client);
|
||||
}
|
||||
|
||||
export function mockLangaugesInRepo(languages: string[]) {
|
||||
const mockClient = sinon.stub(apiClient, "getApiClient");
|
||||
const listLanguages = sinon.stub().resolves({
|
||||
status: 200,
|
||||
data: languages.reduce((acc, lang) => {
|
||||
acc[lang] = 1;
|
||||
return acc;
|
||||
}, {}),
|
||||
headers: {},
|
||||
url: "GET /repos/:owner/:repo/languages",
|
||||
});
|
||||
|
||||
mockClient.returns({
|
||||
repos: {
|
||||
listLanguages,
|
||||
},
|
||||
} as any);
|
||||
return listLanguages;
|
||||
}
|
||||
|
||||
export function mockCodeQLVersion(version) {
|
||||
return {
|
||||
async getVersion() {
|
||||
|
||||
Reference in New Issue
Block a user