Skip to content

Commit

Permalink
chore: fix logic, issue object can be null in github context (#15753)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley authored Nov 11, 2024
1 parent 7d28fe4 commit 0de80e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/close-spam-issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Close Spam Issues
on:
schedule:
- cron: '*/20 * * * *' # Runs every 20 minutes
workflow_dispatch:
workflow_dispatch:

jobs:
close_spam_issues:
Expand All @@ -15,7 +15,7 @@ jobs:
script: |
// ADD SPAM USERS TO THIS LIST
const spamUsers = ['Krakensu'];
const issueCreator = context.payload.issue.user.login;
const issueCreator = context.payload.issue ? context.payload.issue.user.login : null;
async function closeSpamIssues() {
const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
Expand Down

0 comments on commit 0de80e8

Please sign in to comment.