@@ -114,8 +114,12 @@ jobs:
114114 contents : write
115115 steps :
116116 - name : Decode changelog to file
117+ env :
118+ CHANGELOG_B64 : ${{ needs.prepare.outputs.changelog_b64 }}
117119 run : |
118- echo "${{ needs.prepare.outputs.changelog_b64 }}" | base64 --decode > "${{ runner.temp }}/CHANGELOG.md"
120+ [ -n "$CHANGELOG_B64" ] && echo "$CHANGELOG_B64" | base64 --decode > "${{ runner.temp }}/CHANGELOG.md" || true
121+ # Ensure file exists and is not empty
122+ [ -s "${{ runner.temp }}/CHANGELOG.md" ] || echo "Release notes not available." > "${{ runner.temp }}/CHANGELOG.md"
119123
120124 - name : Download CLI artifacts
121125 uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
@@ -382,10 +386,19 @@ jobs:
382386 const assetsDir = process.env.ASSETS_DIR;
383387 const notesFile = path.join(assetsDir, 'CHANGELOG.md');
384388
385- const notes = fs.existsSync(notesFile)
389+ let notes = fs.existsSync(notesFile)
386390 ? fs.readFileSync(notesFile, 'utf8').trim()
387391 : `Promoted from ${rcTag}`;
388392
393+ // Replace RC header with final release header
394+ // From: "[cli/v0.17.0-rc.1] - 2026-02-02"
395+ // To: "[cli/v0.17.0] - promoted from [cli/v0.17.0-rc.1] on 2026-02-16"
396+ const today = new Date().toISOString().split('T')[0];
397+ notes = notes.replace(
398+ /^\[([^\]]+)\]\s*-\s*[\d-]+/,
399+ `[${finalTag}] - promoted from [${rcTag}] on ${today}`
400+ );
401+
389402 const created = await github.rest.repos.createRelease({
390403 owner: context.repo.owner,
391404 repo: context.repo.repo,
0 commit comments