Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/triagebot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aaf2652890697b34d73c14438925cdd360668000
Choose a base ref
..
head repository: rust-lang/triagebot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ee91f2824a63e8ba55a5da82076d8a18a0b37410
Choose a head ref
Showing with 16 additions and 10 deletions.
  1. +3 −2 src/config.rs
  2. +13 −8 src/handlers/no_merges.rs
5 changes: 3 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -97,8 +97,9 @@ pub(crate) struct NoMergesConfig {
/// No action will be taken on PRs with these labels.
#[serde(default)]
pub(crate) exclude_labels: Vec<String>,
/// Set this label on the PR when merge commits are detected.
pub(crate) label: Option<String>,
/// Set these labels on the PR when merge commits are detected.
#[serde(default)]
pub(crate) labels: Vec<String>,
/// Override the default message to post when merge commits are detected.
///
/// This message will always be followed up with
21 changes: 13 additions & 8 deletions src/handlers/no_merges.rs
Original file line number Diff line number Diff line change
@@ -116,6 +116,7 @@ pub(super) async fn handle_input(
write!(
message,
"
The following commits are merge commits{since_last_posted}:
"
)
@@ -133,14 +134,18 @@ pub(super) async fn handle_input(
}

if should_send {
// Set label
if let Some(ref name) = config.label {
event
.issue
.add_labels(&ctx.github, vec![Label { name: name.clone() }])
.await
.context("failed to set no_merges labels")?;
}
// Set labels
let labels = config
.labels
.iter()
.cloned()
.map(|name| Label { name })
.collect();
event
.issue
.add_labels(&ctx.github, labels)
.await
.context("failed to set no_merges labels")?;

// Post comment
event