Skip to content

Commit 7e5fac3

Browse files
committed
Also show warnings when PRs are updated
1 parent a9ed2b9 commit 7e5fac3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/handlers/assign.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub(super) async fn parse_input(
135135
None => return Ok(None),
136136
};
137137
if config.owners.is_empty()
138-
|| !matches!(event.action, IssuesAction::Opened)
138+
|| !matches!(event.action, IssuesAction::Opened | IssuesAction::Synchronize)
139139
|| !event.issue.is_pr()
140140
{
141141
return Ok(None);
@@ -159,7 +159,7 @@ pub(super) async fn handle_input(
159159
};
160160

161161
// Don't auto-assign or welcome if the user manually set the assignee when opening.
162-
if event.issue.assignees.is_empty() {
162+
if matches!(event.action, IssuesAction::Opened) && event.issue.assignees.is_empty() {
163163
let (assignee, from_comment) = determine_assignee(ctx, event, config, &diff).await?;
164164
if assignee.as_deref() == Some("ghost") {
165165
// "ghost" is GitHub's placeholder account for deleted accounts.
@@ -214,7 +214,7 @@ pub(super) async fn handle_input(
214214
}
215215
}
216216

217-
// Compute some warning messages to post to new PRs.
217+
// Compute some warning messages to post to new (and old) PRs.
218218
let mut warnings = Vec::new();
219219
if let Some(exceptions) = config.warn_non_default_branch.enabled_and_exceptions() {
220220
warnings.extend(non_default_branch(exceptions, event));
@@ -228,6 +228,7 @@ pub(super) async fn handle_input(
228228
let warning = format!(":warning: **Warning** :warning:\n\n{}", warnings.join("\n"));
229229
event.issue.post_comment(&ctx.github, &warning).await?;
230230
};
231+
231232
Ok(())
232233
}
233234

0 commit comments

Comments
 (0)