Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mismatch between hook events and github event types (#24048) #24084

Closed

Conversation

GiteaBot
Copy link
Collaborator

Backport #24048 by @Zettat123

Some workflow trigger events can have multiple activity types, such as issues and pull_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-workflows

Now 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 a pull_request_label workflow trigger event, we can only use pull_request event's label activity type. If we don't check the activity types, the workflows without the label activity type may be triggered by the pull_request_label event by mistake. We need to improve the match logic.

Some workflow trigger events can have multiple activity types, such as
`issues` and `pull_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-workflows

Now 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 a
`pull_request_label` workflow trigger event, we can only use
`pull_request` event's `label` activity type. If we don't check the
activity types, the workflows without the `label` activity type may be
triggered by the `pull_request_label` event by mistake. We need to
improve the match logic.

- [x] [`issues`
](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues)
- [x]
[`issue_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment)
- [x]
[`pull_request`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request)
- [x]
[`pull_request_review`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review)
- [x]
[`pull_request_review_comment`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_review_comment)
- [x]
[`release`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release)
- [x]
[`registry_package`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#registry_package)
@GiteaBot GiteaBot added this to the 1.19.1 milestone Apr 12, 2023
@GiteaBot GiteaBot requested review from lunny and silverwind April 12, 2023 16:16
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Apr 12, 2023
@yardenshoham
Copy link
Member

Needs a manual backport, lint fails

@yardenshoham yardenshoham removed this from the 1.19.1 milestone Apr 12, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 31, 2023
@techknowlogick techknowlogick deleted the backport-24048-v1.19 branch September 9, 2023 05:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants