Skip to content

Commit

Permalink
feat: allow the workflow to run on any event action
Browse files Browse the repository at this point in the history
  • Loading branch information
benelan committed Apr 25, 2022
1 parent 3356f55 commit 9bce688
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions package-lock.json

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

9 changes: 2 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ async function run(): Promise<void> {
try {
const {
repo,
payload: {action, sender, issue, pull_request},
payload: {sender, issue, pull_request},
issue: {number: issue_number}
} = context

Expand All @@ -15,11 +15,6 @@ async function run(): Promise<void> {
return
}

if (action !== 'opened') {
console.log('No issue or pull request was opened, ending run.')
return
}

if (!issue && !pull_request) {
console.log(
'The event that triggered this action was not a pull request or issue, ending run.'
Expand Down Expand Up @@ -62,7 +57,7 @@ async function run(): Promise<void> {
return
}
}
} catch (e: unknown) {
} catch (e) {
if (e instanceof Error) {
setFailed(e.message)
}
Expand Down

0 comments on commit 9bce688

Please sign in to comment.