Revert "Retrieve GitHubVersion when used rather than passing around"
This reverts commit 6de1b753c2.
https://github.com/github/codeql-action/pull/323#discussion_r551960301
This commit is contained in:
parent
4bc186cf34
commit
54e0c67332
12 changed files with 33 additions and 15 deletions
|
|
@ -84,6 +84,7 @@ async function run() {
|
|||
);
|
||||
|
||||
if (actionsUtil.getRequiredInput("upload") === "true") {
|
||||
const gitHubVersion = await util.getGitHubVersion(apiDetails);
|
||||
const uploadStats = await upload_lib.uploadFromActions(
|
||||
outputDir,
|
||||
parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")),
|
||||
|
|
@ -94,6 +95,7 @@ async function run() {
|
|||
actionsUtil.getWorkflowRunID(),
|
||||
actionsUtil.getRequiredInput("checkout_path"),
|
||||
actionsUtil.getRequiredInput("matrix"),
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
logger
|
||||
);
|
||||
|
|
|
|||
|
|
@ -392,12 +392,14 @@ program
|
|||
return;
|
||||
}
|
||||
|
||||
const gitHubVersion = await getGitHubVersion(apiDetails);
|
||||
await upload_lib.uploadFromRunner(
|
||||
outputDir,
|
||||
parseRepositoryNwo(cmd.repository),
|
||||
cmd.commit,
|
||||
parseRef(cmd.ref),
|
||||
cmd.checkoutPath || process.cwd(),
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
logger
|
||||
);
|
||||
|
|
@ -451,12 +453,14 @@ program
|
|||
url: parseGithubUrl(cmd.githubUrl),
|
||||
};
|
||||
try {
|
||||
const gitHubVersion = await getGitHubVersion(apiDetails);
|
||||
await upload_lib.uploadFromRunner(
|
||||
cmd.sarifFile,
|
||||
parseRepositoryNwo(cmd.repository),
|
||||
cmd.commit,
|
||||
parseRef(cmd.ref),
|
||||
cmd.checkoutPath || process.cwd(),
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
logger
|
||||
);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ export async function uploadFromActions(
|
|||
workflowRunID: number,
|
||||
checkoutPath: string,
|
||||
environment: string,
|
||||
gitHubVersion: util.GitHubVersion,
|
||||
apiDetails: api.GitHubApiDetails,
|
||||
logger: Logger
|
||||
): Promise<UploadStatusReport> {
|
||||
|
|
@ -107,6 +108,7 @@ export async function uploadFromActions(
|
|||
workflowRunID,
|
||||
checkoutPath,
|
||||
environment,
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
"actions",
|
||||
logger
|
||||
|
|
@ -122,6 +124,7 @@ export async function uploadFromRunner(
|
|||
commitOid: string,
|
||||
ref: string,
|
||||
checkoutPath: string,
|
||||
gitHubVersion: util.GitHubVersion,
|
||||
apiDetails: api.GitHubApiDetails,
|
||||
logger: Logger
|
||||
): Promise<UploadStatusReport> {
|
||||
|
|
@ -135,6 +138,7 @@ export async function uploadFromRunner(
|
|||
undefined,
|
||||
checkoutPath,
|
||||
undefined,
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
"runner",
|
||||
logger
|
||||
|
|
@ -269,6 +273,7 @@ async function uploadFiles(
|
|||
workflowRunID: number | undefined,
|
||||
checkoutPath: string,
|
||||
environment: string | undefined,
|
||||
gitHubVersion: util.GitHubVersion,
|
||||
apiDetails: api.GitHubApiDetails,
|
||||
mode: util.Mode,
|
||||
logger: Logger
|
||||
|
|
@ -303,7 +308,6 @@ async function uploadFiles(
|
|||
|
||||
const toolNames = util.getToolNames(sarifPayload);
|
||||
|
||||
const gitHubVersion = await util.getGitHubVersion(apiDetails);
|
||||
const payload = buildPayload(
|
||||
commitOid,
|
||||
ref,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import * as actionsUtil from "./actions-util";
|
|||
import { getActionsLogger } from "./logging";
|
||||
import { parseRepositoryNwo } from "./repository";
|
||||
import * as upload_lib from "./upload-lib";
|
||||
import { getGitHubVersion } from "./util";
|
||||
|
||||
interface UploadSarifStatusReport
|
||||
extends actionsUtil.StatusReportBase,
|
||||
|
|
@ -45,6 +46,8 @@ async function run() {
|
|||
url: actionsUtil.getRequiredEnvParam("GITHUB_SERVER_URL"),
|
||||
};
|
||||
|
||||
const gitHubVersion = await getGitHubVersion(apiDetails);
|
||||
|
||||
const uploadStats = await upload_lib.uploadFromActions(
|
||||
actionsUtil.getRequiredInput("sarif_file"),
|
||||
parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")),
|
||||
|
|
@ -55,6 +58,7 @@ async function run() {
|
|||
actionsUtil.getWorkflowRunID(),
|
||||
actionsUtil.getRequiredInput("checkout_path"),
|
||||
actionsUtil.getRequiredInput("matrix"),
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
getActionsLogger()
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue