Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit changelog header from GitHub release notes #17165

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion xtask/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ use xshell::{cmd, Shell};

impl flags::PublishReleaseNotes {
pub(crate) fn run(self, sh: &Shell) -> anyhow::Result<()> {
let asciidoc = sh.read_file(&self.changelog)?;
let mut asciidoc = sh.read_file(&self.changelog)?;
// Remove '#' in front of changelog number; GitHub misinterprets it as issue reference
let changelog_header_prefix = "= Changelog ";
let header_hash_sign_index =
asciidoc.find(changelog_header_prefix).expect("should contain changelog header")
+ changelog_header_prefix.len();
asciidoc.remove(header_hash_sign_index);

let mut markdown = notes::convert_asciidoc_to_markdown(std::io::Cursor::new(&asciidoc))?;
let file_name = check_file_name(self.changelog)?;
let tag_name = &file_name[0..10];
Expand Down