Skip to content

Commit

Permalink
🧱 Update scan/dist/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 10, 2024
1 parent e8297ea commit a389a9a
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions scan/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135150,29 +135150,50 @@ var require_utils10 = __commonJS({
}
__name(getInputs, "getInputs");
function getPrSha() {
if (process.env.QODANA_PR_SHA) {
return process.env.QODANA_PR_SHA;
return __awaiter3(this, void 0, void 0, function* () {
if (process.env.QODANA_PR_SHA) {
return process.env.QODANA_PR_SHA;
}
if (github2.context.payload.pull_request !== void 0) {
const output = yield gitOutput([
"merge-base",
github2.context.payload.pull_request.base.sha,
github2.context.payload.pull_request.head.sha
]);
if (output.exitCode === 0) {
return output.stdout.trim();
} else {
return github2.context.payload.pull_request.base.sha;
}
}
return "";
});
}
__name(getPrSha, "getPrSha");
function getHeadSha() {
if (process.env.QODANA_REVISION) {
return process.env.QODANA_REVISION;
}
if (github2.context.payload.pull_request !== void 0) {
return github2.context.payload.pull_request.base.sha;
return github2.context.payload.pull_request.head.sha;
}
return "";
return github2.context.sha;
}
__name(getPrSha, "getPrSha");
__name(getHeadSha, "getHeadSha");
function qodana(inputs_1) {
return __awaiter3(this, arguments, void 0, function* (inputs, args = []) {
if (args.length === 0) {
args = (0, qodana_12.getQodanaScanArgs)(inputs.args, inputs.resultsDir, inputs.cacheDir);
if (inputs.prMode) {
const sha = getPrSha();
const sha = yield getPrSha();
if (sha !== "") {
args.push("--commit", sha);
}
}
}
return (yield exec.getExecOutput(qodana_12.EXECUTABLE, args, {
ignoreReturnCode: true,
env: Object.assign(Object.assign({}, process.env), { NONINTERACTIVE: "1" })
env: Object.assign(Object.assign({}, process.env), { QODANA_REVISION: getHeadSha(), NONINTERACTIVE: "1" })
})).exitCode;
});
}
Expand Down Expand Up @@ -135469,6 +135490,12 @@ ${comment_tag_pattern}`;
});
}
__name(git, "git");
function gitOutput(args_1) {
return __awaiter3(this, arguments, void 0, function* (args, options = {}) {
return yield exec.getExecOutput("git", args, options);
});
}
__name(gitOutput, "gitOutput");
function createPr(title, repo, base, head) {
return __awaiter3(this, void 0, void 0, function* () {
const prBodyFile = path_1.default.join(os.tmpdir(), "pr-body.txt");
Expand Down

0 comments on commit a389a9a

Please sign in to comment.