Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3641,9 +3641,13 @@ const inputs_1 = __webpack_require__(575);
const checks_1 = __webpack_require__(96);
exports.envVariableName = 'DFLYDEV_CHECK_RUN_COLLECTIONS';
function run() {
var _a, _b, _c;
return __awaiter(this, void 0, void 0, function* () {
try {
core.debug(`GITHUB_SHA: ${process.env['GITHUB_SHA']} (${github.context.sha} from context)`);
const triggeringSha = github.context.sha;
core.debug(`GITHUB_SHA: ${process.env['GITHUB_SHA']} (${triggeringSha} from context)`);
const pullRequestHeadSha = (_c = (_b = (_a = github.context.payload) === null || _a === void 0 ? void 0 : _a.pull_request) === null || _b === void 0 ? void 0 : _b.head) === null || _c === void 0 ? void 0 : _c.sha;
core.debug(`GITHUB_PULL_REQUEST_HEAD_SHA: ${process.env['GITHUB_PULL_REQUEST_HEAD_SHA']} (${pullRequestHeadSha} from context)`);
core.debug(`GITHUB_EVENT_PATH: ${process.env['GITHUB_EVENT_PATH']}`);
core.debug(`Parsing inputs`);
const inputs = inputs_1.parseInputs(core.getInput);
Expand All @@ -3654,8 +3658,9 @@ function run() {
owner: github.context.repo.owner,
repo: github.context.repo.repo,
};
const sha = github.context.sha;
core.debug(JSON.stringify(ownership));
const sha = pullRequestHeadSha || triggeringSha;
core.debug(`Effective ref to attach check runs to: ${sha}`);
for (const collectedCheckRun of inputs.runContext.collectedCheckRuns) {
const collection = collectedCheckRun.collection;
const checkRun = collectedCheckRun.checkRun;
Expand Down
15 changes: 10 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ import * as github from '@actions/github'
import {parseInputs} from './inputs'
import {createRun, updateRun} from './checks'

import {wait} from './wait'

export const envVariableName = 'DFLYDEV_CHECK_RUN_COLLECTIONS'

async function run(): Promise<void> {
try {
const triggeringSha = github.context.sha
core.debug(
`GITHUB_SHA: ${process.env['GITHUB_SHA']} (${triggeringSha} from context)`,
)

const pullRequestHeadSha = github.context.payload?.pull_request?.head?.sha
core.debug(
`GITHUB_SHA: ${process.env['GITHUB_SHA']} (${github.context.sha} from context)`,
`GITHUB_PULL_REQUEST_HEAD_SHA: ${process.env['GITHUB_PULL_REQUEST_HEAD_SHA']} (${pullRequestHeadSha} from context)`,
)

core.debug(`GITHUB_EVENT_PATH: ${process.env['GITHUB_EVENT_PATH']}`)
Expand All @@ -28,10 +32,11 @@ async function run(): Promise<void> {
repo: github.context.repo.repo,
}

const sha = github.context.sha

core.debug(JSON.stringify(ownership))

const sha = pullRequestHeadSha || triggeringSha
core.debug(`Effective ref to attach check runs to: ${sha}`)

for (const collectedCheckRun of inputs.runContext.collectedCheckRuns) {
const collection = collectedCheckRun.collection
const checkRun = collectedCheckRun.checkRun
Expand Down