Fix mismatch between hook events and github event types (#24048) #24084
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #24048 by @Zettat123
Some workflow trigger events can have multiple activity types, such as
issues
andpull_request
, and user can specify which types can trigger the workflow. See GitHub documentation: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflowsNow some hook events cannot match the workflow trigger events correctly because we don't check the activity types. For example,
pull_request_label
is an individual hook event. But there isn't apull_request_label
workflow trigger event, we can only usepull_request
event'slabel
activity type. If we don't check the activity types, the workflows without thelabel
activity type may be triggered by thepull_request_label
event by mistake. We need to improve the match logic.issues
issue_comment
pull_request
pull_request_review
pull_request_review_comment
release
registry_package