Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| var commandChecks []ConditionNode | ||
|
|
||
| // Check which events are enabled and build appropriate checks | ||
| hasIssues := containsEventName(eventNames, "issues") |
| Right: prBodyCheck, | ||
| var commandCondition ConditionNode | ||
| if len(commandChecks) == 0 { | ||
| // No events enabled, this should not happen but handle gracefully |
| commandCondition = commandChecks[0] | ||
| } else { | ||
| // Build OR chain for multiple checks | ||
| commandCondition = commandChecks[0] |
There was a problem hiding this comment.
@copilot use helper to build disjunction with array it will handle all the cases (1 and more)
There was a problem hiding this comment.
Fixed in cf09d04. Replaced manual OR chain building with DisjunctionNode which elegantly handles single, multiple, and all cases.
| } | ||
|
|
||
| // containsEventName checks if a slice of event names contains a specific event name | ||
| func containsEventName(eventNames []string, eventName string) bool { |
|
@copilot update scout.md to target issue and issue_comment events |
…a, and panic on invalid events Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
I couldn't find scout.md in the repository. Could you provide the path to the file or let me know if this is a new file that needs to be created? If it's an existing workflow, please specify its location. |
|
@copilot use event names that match the GitHub actions "on" trigger section names. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in 52a6611. Removed all short aliases (issue, comment, pr, pr_review) and now only accept GitHub Actions event names (issues, issue_comment, pull_request, pull_request_review_comment) as specified in the "on" trigger section. Schema validation ensures only valid GitHub Actions event names are accepted. |
| commentEventTerms = append(commentEventTerms, BuildEventTypeEquals(eventName)) | ||
| } | ||
|
|
||
| commentEventChecks := &DisjunctionNode{ |
There was a problem hiding this comment.
- use buildDisjunction helper
- make sure buildDisjunction handles case with array of size 1
There was a problem hiding this comment.
Fixed in f92c045. Created BuildDisjunction helper function and used it in both places (lines 58 and 74). The helper correctly handles arrays of size 1 by leveraging DisjunctionNode.Render() which returns just the single term without OR operators for single-element arrays.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…tion Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main, format, lint, recompile |
…ot/add-events-field-to-command
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in fba6920. Successfully merged main branch, formatted code, ran linter (all checks passed), and recompiled all 50 workflows. The recompilation produced cleaner condition expressions with fewer unnecessary parentheses thanks to the improved BuildDisjunction logic. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in 9b2aba6:
Both event identifiers map to the underlying GitHub Actions |
|
|
@copilot merge main, format, lint, recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated documentation in commit a0ea28d:
All documentation now clearly explains the new |
…ot/add-events-field-to-command
Completed. Merged main branch, formatted code, ran linter (all checks passed), and successfully recompiled all 50 workflows. |
Summary
This PR adds an
eventsfield to thecommandconfiguration in theonsection, allowing users to specify which comment-related events should trigger their command workflows using GitHub Actions event names.Recent Updates
Latest (commit pending): Merged main branch, formatted code, ran linter (all checks passed), and successfully recompiled all 50 workflows.
Previous update: Updated documentation for the command events filtering feature in ChatOps guide, command triggers reference, and instructions template.
Implementation Checklist
Key Features
Event Filtering
Users can now specify which events should trigger their command using GitHub Actions event names:
Supported event names (matching GitHub Actions "on" trigger section):
issues- Issue bodies (opened, edited, reopened)issue_comment- Issue comments only (created, edited) - excludes PR commentspull_request_comment- Pull request comments only (created, edited) - excludes issue commentspull_request- Pull request bodies (opened, edited, reopened)pull_request_review_comment- Pull request review comments (created, edited)*- Wildcard for all comment-related events (default)Separate Issue and PR Comment Events
The new
pull_request_commentevent identifier enables precise filtering:issue_comment: Maps to GitHub Actionsissue_commentevent with filtergithub.event.issue.pull_request == null(comments on issues only)pull_request_comment: Maps to GitHub Actionsissue_commentevent with filtergithub.event.issue.pull_request != null(comments on PRs only)This allows workflows to target only issue comments or only PR comments, providing better control and reducing unnecessary workflow runs.
Default Behavior
Commands without the
eventsfield continue to work on all comment-related events (backward compatible).Benefits
Testing
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.