Skip to content

Commit

Permalink
fetch the issueNumber from the github.context if it is not define…
Browse files Browse the repository at this point in the history
…d in the inputs
  • Loading branch information
GrantBirki committed Jul 31, 2024
1 parent ce03eec commit 7f657e1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@ async function run() {
? core.getInput('reactions')
: core.getInput('reaction-type')
}

// in most cases, ${{ github.event.number }} is the issue number
// if it is blank, then try to fetch it from the context
core.debug(
`github.context.payload.issue.number: ${github.context.payload.issue.number}`
)
if (!inputs.issueNumber) {
core.debug(
`issueNumber is not set, trying to fetch from the github.context`
)
inputs.issueNumber = github.context.payload.issue.number
}

core.debug(`Inputs: ${inspect(inputs)}`)

// Get the GitHub repository
Expand Down

0 comments on commit 7f657e1

Please sign in to comment.