diff options
| author | bors <bors@rust-lang.org> | 2024-06-22 11:57:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-22 11:57:52 +0000 |
| commit | 70e9582f4c076a6b22ba4844f075762a1ed2296b (patch) | |
| tree | 5d1fe8638914bc026acde56a98fc7c60440b1e3e | |
| parent | 9b33872c898382c8eed329a5fe08b225102400ae (diff) | |
| parent | 0744b36d53d127dd1e721086cc73ebf28797f4d4 (diff) | |
| download | rust-70e9582f4c076a6b22ba4844f075762a1ed2296b.tar.gz rust-70e9582f4c076a6b22ba4844f075762a1ed2296b.zip | |
Auto merge of #17475 - lnicola:changelog-title, r=lnicola
minor: Remove Changelog: XXX title from Github release notes Fixes #16455 Closes #17165
| -rw-r--r-- | src/tools/rust-analyzer/xtask/src/publish.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/xtask/src/publish.rs b/src/tools/rust-analyzer/xtask/src/publish.rs index 7faae9b20c4..f5d765d7c98 100644 --- a/src/tools/rust-analyzer/xtask/src/publish.rs +++ b/src/tools/rust-analyzer/xtask/src/publish.rs @@ -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); |
