Skip to content

Commit 8630882

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

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

dist/post_run/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6852,16 +6852,17 @@ 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(ctx, false, 4));
6862+
const ref = (_a = ctx.payload.after) !== null && _a !== void 0 ? _a : ctx.sha;
68626863
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }));
68636864
const checkRunsPromise = octokit.checks
6864-
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: "in_progress" }))
6865+
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: `in_progress`, filter: `latest` }))
68656866
.catch((e) => {
68666867
throw `Error getting Check Run Data: ${e}`;
68676868
});
@@ -6906,6 +6907,7 @@ function annotateLintIssues(issues) {
69066907
});
69076908
let checkRun;
69086909
const { data: checkRunsResponse } = yield checkRunsPromise;
6910+
core.info(util_1.inspect(checkRunsResponse, false, 4));
69096911
if (checkRunsResponse.check_runs.length === 0) {
69106912
throw `octokit.checks.listForRef(${ref}) returned no results`;
69116913
}
@@ -6915,7 +6917,7 @@ function annotateLintIssues(issues) {
69156917
if (!(checkRun === null || checkRun === void 0 ? void 0 : checkRun.id)) {
69166918
throw `Could not find current check run`;
69176919
}
6918-
const title = (_a = checkRun.output.title) !== null && _a !== void 0 ? _a : `GolangCI-Lint`;
6920+
const title = (_b = checkRun.output.title) !== null && _b !== void 0 ? _b : `GolangCI-Lint`;
69196921
const summary = `There are {issueCounts.failure} failures, {issueCounts.wairning} warnings, and {issueCounts.notice} notices.`;
69206922
Array.from({ length: Math.ceil(githubAnnotations.length / chunkSize) }, (v, i) => githubAnnotations.slice(i * chunkSize, i * chunkSize + chunkSize)).forEach((annotations) => {
69216923
octokit.checks

dist/run/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6862,16 +6862,17 @@ 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(ctx, false, 4));
6872+
const ref = (_a = ctx.payload.after) !== null && _a !== void 0 ? _a : ctx.sha;
68726873
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }));
68736874
const checkRunsPromise = octokit.checks
6874-
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: "in_progress" }))
6875+
.listForRef(Object.assign(Object.assign({}, ctx.repo), { ref, status: `in_progress`, filter: `latest` }))
68756876
.catch((e) => {
68766877
throw `Error getting Check Run Data: ${e}`;
68776878
});
@@ -6916,6 +6917,7 @@ function annotateLintIssues(issues) {
69166917
});
69176918
let checkRun;
69186919
const { data: checkRunsResponse } = yield checkRunsPromise;
6920+
core.info(util_1.inspect(checkRunsResponse, false, 4));
69196921
if (checkRunsResponse.check_runs.length === 0) {
69206922
throw `octokit.checks.listForRef(${ref}) returned no results`;
69216923
}
@@ -6925,7 +6927,7 @@ function annotateLintIssues(issues) {
69256927
if (!(checkRun === null || checkRun === void 0 ? void 0 : checkRun.id)) {
69266928
throw `Could not find current check run`;
69276929
}
6928-
const title = (_a = checkRun.output.title) !== null && _a !== void 0 ? _a : `GolangCI-Lint`;
6930+
const title = (_b = checkRun.output.title) !== null && _b !== void 0 ? _b : `GolangCI-Lint`;
69296931
const summary = `There are {issueCounts.failure} failures, {issueCounts.wairning} warnings, and {issueCounts.notice} notices.`;
69306932
Array.from({ length: Math.ceil(githubAnnotations.length / chunkSize) }, (v, i) => githubAnnotations.slice(i * chunkSize, i * chunkSize + chunkSize)).forEach((annotations) => {
69316933
octokit.checks

src/run.ts

Lines changed: 6 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,15 @@ async function annotateLintIssues(issues: LintIssue[]): Promise<void> {
236236
return
237237
}
238238
const ctx = github.context
239-
const ref = ctx.payload.after
239+
core.info(inspect(ctx, false, 4))
240+
const ref = ctx.payload.after ?? ctx.sha
240241
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }))
241242
const checkRunsPromise = octokit.checks
242243
.listForRef({
243244
...ctx.repo,
244245
ref,
245-
status: "in_progress",
246+
status: `in_progress`,
247+
filter: `latest`,
246248
})
247249
.catch((e) => {
248250
throw `Error getting Check Run Data: ${e}`
@@ -293,6 +295,7 @@ async function annotateLintIssues(issues: LintIssue[]): Promise<void> {
293295
)
294296
let checkRun: CheckRun | undefined
295297
const { data: checkRunsResponse } = await checkRunsPromise
298+
core.info(inspect(checkRunsResponse, false, 4))
296299
if (checkRunsResponse.check_runs.length === 0) {
297300
throw `octokit.checks.listForRef(${ref}) returned no results`
298301
} else {

0 commit comments

Comments
 (0)