···358358 print $"Extracting notes for tag: ($tag_v) \(searching for section [($tag)]\)"
359359360360 # Write header to output file
361361- "# What's new\n" | save $outfile
361361+ "# What's new\n" | save --force $outfile
362362363363 # Read and process changelog
364364 let content = (open $changelog_file | lines)
365365- let section_header = $"## [($tag)]"
366365367366 # Find the start of the target section
368368- let start_idx = ($content | enumerate | where item == $section_header | get index | first)
367367+ let start_idx = ($content | enumerate | where ($it.item | str contains $tag) | get index | first)
369368370369 if ($start_idx | is-empty) {
371371- build_error $"Could not find section header ($section_header) in ($changelog_file)"
370370+ build_error $"Could not find tag ($tag) in ($changelog_file)"
372371 }
373372374373 # Find the end of the target section (next ## [ header)
···389388 if $output_size > 20 { # More than just the header
390389 print $"Successfully extracted release notes to '($outfile)'."
391390 } else {
392392- print --stderr $"Warning: '($outfile)' appears empty. Is '($section_header)' present in '($changelog_file)'?"
391391+ print --stderr $"Warning: '($outfile)' appears empty. Is '($tag)' present in '($changelog_file)'?"
393392 }
394393395394 } catch { |e|