Skip to content

Commit

Permalink
Auto merge of #17475 - lnicola:changelog-title, r=lnicola
Browse files Browse the repository at this point in the history
minor: Remove Changelog: XXX title from Github release notes

Fixes #16455
Closes #17165
  • Loading branch information
bors committed Jun 22, 2024
2 parents 9b33872 + 0744b36 commit 70e9582
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tools/rust-analyzer/xtask/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ impl flags::PublishReleaseNotes {
pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> {
let asciidoc = sh.read_file(&self.changelog)?;
let mut markdown = notes::convert_asciidoc_to_markdown(std::io::Cursor::new(&asciidoc))?;
if !markdown.starts_with("# Changelog") {
bail!("changelog Markdown should start with `# Changelog`");
}
const NEWLINES: &str = "\n\n";
let Some(idx) = markdown.find(NEWLINES) else {
bail!("missing newlines after changelog title");
};
markdown.replace_range(0..idx + NEWLINES.len(), "");

let file_name = check_file_name(self.changelog)?;
let tag_name = &file_name[0..10];
let original_changelog_url = create_original_changelog_url(&file_name);
Expand Down

0 comments on commit 70e9582

Please sign in to comment.