Retrieve GitHubVersion when used rather than passing around
This commit is contained in:
parent
45dd5ee97d
commit
6de1b753c2
12 changed files with 15 additions and 33 deletions
|
|
@ -84,7 +84,6 @@ async function run() {
|
|||
return;
|
||||
}
|
||||
|
||||
const gitHubVersion = await util.getGitHubVersion(apiDetails);
|
||||
const uploadStats = await upload_lib.uploadFromActions(
|
||||
outputDir,
|
||||
parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")),
|
||||
|
|
@ -95,7 +94,6 @@ async function run() {
|
|||
actionsUtil.getWorkflowRunID(),
|
||||
actionsUtil.getRequiredInput("checkout_path"),
|
||||
actionsUtil.getRequiredInput("matrix"),
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
logger
|
||||
);
|
||||
|
|
|
|||
|
|
@ -392,14 +392,12 @@ 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
|
||||
);
|
||||
|
|
@ -453,14 +451,12 @@ 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,7 +94,6 @@ export async function uploadFromActions(
|
|||
workflowRunID: number,
|
||||
checkoutPath: string,
|
||||
environment: string,
|
||||
gitHubVersion: util.GitHubVersion,
|
||||
apiDetails: api.GitHubApiDetails,
|
||||
logger: Logger
|
||||
): Promise<UploadStatusReport> {
|
||||
|
|
@ -108,7 +107,6 @@ export async function uploadFromActions(
|
|||
workflowRunID,
|
||||
checkoutPath,
|
||||
environment,
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
"actions",
|
||||
logger
|
||||
|
|
@ -124,7 +122,6 @@ export async function uploadFromRunner(
|
|||
commitOid: string,
|
||||
ref: string,
|
||||
checkoutPath: string,
|
||||
gitHubVersion: util.GitHubVersion,
|
||||
apiDetails: api.GitHubApiDetails,
|
||||
logger: Logger
|
||||
): Promise<UploadStatusReport> {
|
||||
|
|
@ -138,7 +135,6 @@ export async function uploadFromRunner(
|
|||
undefined,
|
||||
checkoutPath,
|
||||
undefined,
|
||||
gitHubVersion,
|
||||
apiDetails,
|
||||
"runner",
|
||||
logger
|
||||
|
|
@ -273,7 +269,6 @@ async function uploadFiles(
|
|||
workflowRunID: number | undefined,
|
||||
checkoutPath: string,
|
||||
environment: string | undefined,
|
||||
gitHubVersion: util.GitHubVersion,
|
||||
apiDetails: api.GitHubApiDetails,
|
||||
mode: util.Mode,
|
||||
logger: Logger
|
||||
|
|
@ -308,6 +303,7 @@ async function uploadFiles(
|
|||
|
||||
const toolNames = util.getToolNames(sarifPayload);
|
||||
|
||||
const gitHubVersion = await util.getGitHubVersion(apiDetails);
|
||||
const payload = buildPayload(
|
||||
commitOid,
|
||||
ref,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ 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,
|
||||
|
|
@ -46,8 +45,6 @@ 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")),
|
||||
|
|
@ -58,7 +55,6 @@ 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