Skip to content

Commit

Permalink
fix: read eventName from correct payload (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez authored Jul 8, 2022
1 parent 5267d1a commit 1d4d398
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import core from '@actions/core'
import { context } from '@actions/github'

const getPrNumber = () => {
const { eventName, payload, workflow_run: workflowRun } = context
const { eventName, payload } = context

if (eventName === 'pull_request') {
return payload.number
}

if (
eventName === 'workflow_run' &&
workflowRun?.event === 'pull_request' &&
payload?.workflow_run?.event === 'pull_request' &&
payload?.workflow_run?.pull_requests?.length === 1
) {
return payload.workflow_run.pull_requests[0].number
Expand Down

0 comments on commit 1d4d398

Please sign in to comment.