Skip to content

Commit

Permalink
Adapt release notes generator to use merge state instead of bors (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
cart authored Jun 27, 2023
1 parent af7bedb commit cbea037
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion generate-release/src/github_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ pub struct GithubUserSearchResponse {
pub items: Vec<GithubUser>,
}

#[derive(Deserialize, Clone, Debug)]
pub struct GithubIssuesResponsePullRequest {
pub merged_at: Option<String>,
}

#[derive(Deserialize, Clone, Debug)]
pub struct GithubIssuesResponse {
pub title: String,
Expand All @@ -85,6 +90,7 @@ pub struct GithubIssuesResponse {
pub labels: Vec<GithubLabel>,
pub user: GithubUser,
pub closed_at: DateTime<Utc>,
pub pull_request: Option<GithubIssuesResponsePullRequest>,
}

pub struct GithubClient {
Expand Down Expand Up @@ -219,7 +225,12 @@ impl GithubClient {
Ok(response
.iter()
// Make sure to only get the PRs that were merged by bors
.filter(|pr| pr.title.starts_with("[Merged by Bors] - "))
.filter(|pr| {
pr.pull_request
.as_ref()
.map(|pr| pr.merged_at.is_some())
.unwrap_or(false)
})
.cloned()
.collect())
}
Expand Down

0 comments on commit cbea037

Please sign in to comment.