Skip to content

Commit

Permalink
Update Autosubmit github-webhook to publish to separate topics for pu…
Browse files Browse the repository at this point in the history
…ll requests (#2939)

Add revert requests to a separate topic in pubsub.

List which issues are fixed by this PR. You must list at least one issue.
Part of flutter/flutter#113867

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
  • Loading branch information
ricardoamador authored Jul 19, 2023
1 parent 771ceba commit ac4eab2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions auto_submit/lib/requests/github_webhook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ class GithubWebhook extends RequestHandler {
hasAutosubmit = pullRequest.labels!.any((label) => label.name == Config.kAutosubmitLabel);
hasRevertLabel = pullRequest.labels!.any((label) => label.name == Config.kRevertLabel);

if (hasAutosubmit || hasRevertLabel) {
log.info('Found pull request with auto submit and/or revert label.');
if (hasRevertLabel) {
log.info('Found pull request with revert label.');
await pubsub.publish(config.pubsubRevertRequestTopic, pullRequest);
} else if (hasAutosubmit) {
log.info('Found pull request with autosubmit label.');
await pubsub.publish(config.pubsubPullRequestTopic, pullRequest);
}

Expand Down

0 comments on commit ac4eab2

Please sign in to comment.