Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-ge authored Oct 20, 2023
1 parent 2066bb8 commit 7d6bca2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
let issueBody = '';
// Check if the trigger was an issue or comment event
if (context.eventName === 'issues') {
if (context.eventName === 'issues' && context.payload.issue) {
issueBody = context.payload.issue.body;
} else if (context.eventName === 'issue_comment') {
} else if (context.eventName === 'issue_comment' && context.payload.comment) {
issueBody = context.payload.comment.body;
}
// Check if the content contains "hello"
if (issueBody.includes('hello')) {
// Ensure issueBody is not undefined or null before proceeding
if (issueBody && issueBody.includes('hello')) {
// Add a comment to the current issue
await github.rest.issues.createComment({
owner: repositoryContext.owner,
Expand Down

0 comments on commit 7d6bca2

Please sign in to comment.