Skip to content

Commit 0e2641e

Browse files
committed
Also show warnings when PRs are updated
1 parent a9ed2b9 commit 0e2641e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/handlers/assign.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ 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!(
139+
event.action,
140+
IssuesAction::Opened | IssuesAction::Synchronize
141+
)
139142
|| !event.issue.is_pr()
140143
{
141144
return Ok(None);
@@ -159,7 +162,7 @@ pub(super) async fn handle_input(
159162
};
160163

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

217-
// Compute some warning messages to post to new PRs.
220+
// Compute some warning messages to post to new (and old) PRs.
218221
let mut warnings = Vec::new();
219222
if let Some(exceptions) = config.warn_non_default_branch.enabled_and_exceptions() {
220223
warnings.extend(non_default_branch(exceptions, event));
@@ -228,6 +231,7 @@ pub(super) async fn handle_input(
228231
let warning = format!(":warning: **Warning** :warning:\n\n{}", warnings.join("\n"));
229232
event.issue.post_comment(&ctx.github, &warning).await?;
230233
};
234+
231235
Ok(())
232236
}
233237

0 commit comments

Comments
 (0)