Skip to content
Merged
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ const {GITHUB_REPOSITORY} = process.env;
*/
function guessPrNumber() {
if ('pull_request' === github.context.eventName) {
return github.context.payload.number
}
if ('workflow_run' === github.context.eventName) {
return 'pull_request' === github.context.payload.workflow_run.event
? github.context.payload.pull_requests[0]?.number
: undefined
;
return github.context.payload.number;
} else if ('workflow_run' === github.context.eventName && 'pull_request' === github.context.payload.workflow_run.event) {
return github.context.payload.pull_requests[0]?.number;
}

return undefined;
Expand Down Expand Up @@ -53,7 +49,7 @@ function guessTriggeringWorkflowName() {
*/
function guessRunId() {
if ('workflow_run' === github.context.eventName) {
return github.context.payload.id.toString();
return github.context.payload.workflow.id.toString();
}

return github.context.runId.toString();
Expand Down