Skip to content

Commit 94f1966

Browse files
committed
WHAT DO YOU SEEEEEE
1 parent 6910ba7 commit 94f1966

File tree

3 files changed

+60
-11
lines changed

3 files changed

+60
-11
lines changed

dist/post_run/index.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6852,16 +6852,29 @@ const logLintIssues = (issues) => {
68526852
});
68536853
};
68546854
function annotateLintIssues(issues) {
6855-
var _a;
6855+
var _a, _b;
68566856
return __awaiter(this, void 0, void 0, function* () {
68576857
if (!issues.length) {
68586858
return;
68596859
}
68606860
const ctx = github.context;
6861-
const ref = ctx.payload.after;
6861+
core.info(util_1.inspect({
6862+
ctx: ctx,
6863+
GITHUB_WORKFLOW: process.env["GITHUB_WORKFLOW"],
6864+
GITHUB_RUN_ID: process.env["GITHUB_RUN_ID"],
6865+
GITHUB_RUN_NUMBER: process.env["GITHUB_RUN_NUMBER"],
6866+
GITHUB_JOB: process.env["GITHUB_JOB"],
6867+
GITHUB_ACTION: process.env["GITHUB_ACTION"],
6868+
GITHUB_ACTIONS: process.env["GITHUB_ACTIONS"],
6869+
GITHUB_SHA: process.env["GITHUB_SHA"],
6870+
GITHUB_REF: process.env["GITHUB_REF"],
6871+
GITHUB_HEAD_REF: process.env["GITHUB_HEAD_REF"],
6872+
GITHUB_BASE_REF: process.env["GITHUB_BASE_REF"],
6873+
}, false, 4));
6874+
const ref = (_a = ctx.payload.after) !== null && _a !== void 0 ? _a : ctx.sha;
68626875
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }));
68636876
const checkRunsPromise = octokit.checks
6864-
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: "in_progress" }))
6877+
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: `in_progress`, filter: `latest` }))
68656878
.catch((e) => {
68666879
throw `Error getting Check Run Data: ${e}`;
68676880
});
@@ -6906,6 +6919,7 @@ function annotateLintIssues(issues) {
69066919
});
69076920
let checkRun;
69086921
const { data: checkRunsResponse } = yield checkRunsPromise;
6922+
core.info(util_1.inspect(checkRunsResponse, false, 4));
69096923
if (checkRunsResponse.check_runs.length === 0) {
69106924
throw `octokit.checks.listForRef(${ref}) returned no results`;
69116925
}
@@ -6915,7 +6929,7 @@ function annotateLintIssues(issues) {
69156929
if (!(checkRun === null || checkRun === void 0 ? void 0 : checkRun.id)) {
69166930
throw `Could not find current check run`;
69176931
}
6918-
const title = (_a = checkRun.output.title) !== null && _a !== void 0 ? _a : `GolangCI-Lint`;
6932+
const title = (_b = checkRun.output.title) !== null && _b !== void 0 ? _b : `GolangCI-Lint`;
69196933
const summary = `There are {issueCounts.failure} failures, {issueCounts.wairning} warnings, and {issueCounts.notice} notices.`;
69206934
Array.from({ length: Math.ceil(githubAnnotations.length / chunkSize) }, (v, i) => githubAnnotations.slice(i * chunkSize, i * chunkSize + chunkSize)).forEach((annotations) => {
69216935
octokit.checks

dist/run/index.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6862,16 +6862,29 @@ const logLintIssues = (issues) => {
68626862
});
68636863
};
68646864
function annotateLintIssues(issues) {
6865-
var _a;
6865+
var _a, _b;
68666866
return __awaiter(this, void 0, void 0, function* () {
68676867
if (!issues.length) {
68686868
return;
68696869
}
68706870
const ctx = github.context;
6871-
const ref = ctx.payload.after;
6871+
core.info(util_1.inspect({
6872+
ctx: ctx,
6873+
GITHUB_WORKFLOW: process.env["GITHUB_WORKFLOW"],
6874+
GITHUB_RUN_ID: process.env["GITHUB_RUN_ID"],
6875+
GITHUB_RUN_NUMBER: process.env["GITHUB_RUN_NUMBER"],
6876+
GITHUB_JOB: process.env["GITHUB_JOB"],
6877+
GITHUB_ACTION: process.env["GITHUB_ACTION"],
6878+
GITHUB_ACTIONS: process.env["GITHUB_ACTIONS"],
6879+
GITHUB_SHA: process.env["GITHUB_SHA"],
6880+
GITHUB_REF: process.env["GITHUB_REF"],
6881+
GITHUB_HEAD_REF: process.env["GITHUB_HEAD_REF"],
6882+
GITHUB_BASE_REF: process.env["GITHUB_BASE_REF"],
6883+
}, false, 4));
6884+
const ref = (_a = ctx.payload.after) !== null && _a !== void 0 ? _a : ctx.sha;
68726885
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }));
68736886
const checkRunsPromise = octokit.checks
6874-
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: "in_progress" }))
6887+
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: `in_progress`, filter: `latest` }))
68756888
.catch((e) => {
68766889
throw `Error getting Check Run Data: ${e}`;
68776890
});
@@ -6916,6 +6929,7 @@ function annotateLintIssues(issues) {
69166929
});
69176930
let checkRun;
69186931
const { data: checkRunsResponse } = yield checkRunsPromise;
6932+
core.info(util_1.inspect(checkRunsResponse, false, 4));
69196933
if (checkRunsResponse.check_runs.length === 0) {
69206934
throw `octokit.checks.listForRef(${ref}) returned no results`;
69216935
}
@@ -6925,7 +6939,7 @@ function annotateLintIssues(issues) {
69256939
if (!(checkRun === null || checkRun === void 0 ? void 0 : checkRun.id)) {
69266940
throw `Could not find current check run`;
69276941
}
6928-
const title = (_a = checkRun.output.title) !== null && _a !== void 0 ? _a : `GolangCI-Lint`;
6942+
const title = (_b = checkRun.output.title) !== null && _b !== void 0 ? _b : `GolangCI-Lint`;
69296943
const summary = `There are {issueCounts.failure} failures, {issueCounts.wairning} warnings, and {issueCounts.notice} notices.`;
69306944
Array.from({ length: Math.ceil(githubAnnotations.length / chunkSize) }, (v, i) => githubAnnotations.slice(i * chunkSize, i * chunkSize + chunkSize)).forEach((annotations) => {
69316945
octokit.checks

src/run.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { exec, ExecOptions } from "child_process"
55
import * as fs from "fs"
66
import * as path from "path"
77
import { dir } from "tmp"
8-
import { promisify } from "util"
8+
import { inspect, promisify } from "util"
99

1010
import { restoreCache, saveCache } from "./cache"
1111
import { installGo, installLint } from "./install"
@@ -236,13 +236,33 @@ async function annotateLintIssues(issues: LintIssue[]): Promise<void> {
236236
return
237237
}
238238
const ctx = github.context
239-
const ref = ctx.payload.after
239+
core.info(
240+
inspect(
241+
{
242+
ctx: ctx,
243+
GITHUB_WORKFLOW: process.env["GITHUB_WORKFLOW"],
244+
GITHUB_RUN_ID: process.env["GITHUB_RUN_ID"],
245+
GITHUB_RUN_NUMBER: process.env["GITHUB_RUN_NUMBER"],
246+
GITHUB_JOB: process.env["GITHUB_JOB"],
247+
GITHUB_ACTION: process.env["GITHUB_ACTION"],
248+
GITHUB_ACTIONS: process.env["GITHUB_ACTIONS"],
249+
GITHUB_SHA: process.env["GITHUB_SHA"],
250+
GITHUB_REF: process.env["GITHUB_REF"],
251+
GITHUB_HEAD_REF: process.env["GITHUB_HEAD_REF"],
252+
GITHUB_BASE_REF: process.env["GITHUB_BASE_REF"],
253+
},
254+
false,
255+
4
256+
)
257+
)
258+
const ref = ctx.payload.after ?? ctx.sha
240259
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }))
241260
const checkRunsPromise = octokit.checks
242261
.listForRef({
243262
...ctx.repo,
244263
ref,
245-
status: "in_progress",
264+
status: `in_progress`,
265+
filter: `latest`,
246266
})
247267
.catch((e) => {
248268
throw `Error getting Check Run Data: ${e}`
@@ -293,6 +313,7 @@ async function annotateLintIssues(issues: LintIssue[]): Promise<void> {
293313
)
294314
let checkRun: CheckRun | undefined
295315
const { data: checkRunsResponse } = await checkRunsPromise
316+
core.info(inspect(checkRunsResponse, false, 4))
296317
if (checkRunsResponse.check_runs.length === 0) {
297318
throw `octokit.checks.listForRef(${ref}) returned no results`
298319
} else {

0 commit comments

Comments
 (0)