Skip to content

Commit 6d5a207

Browse files
committed
no message
1 parent 49edc96 commit 6d5a207

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

.github/workflows/release-management.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,20 @@ jobs:
129129
130130
# Check if this is a PR from develop to main
131131
if [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.head.ref }}" == "develop" ]]; then
132-
# Get the PR body content between markers using grep and sed
133-
PR_CONTENT=$(echo '${{ github.event.pull_request.body }}' | sed -n '/^## Changelog/,/^This PR contains all changes/p' | sed '$ d')
132+
# Get the PR body content, carefully excluding the pending @since section
133+
PR_CONTENT=$(echo '${{ github.event.pull_request.body }}' | awk '
134+
BEGIN { p=0; in_since=0 }
135+
/^## Changelog/ { p=1; print; next }
136+
/^### 🔄 Pending `@since` Tag/ { in_since=1; next }
137+
/^###/ && in_since { in_since=0 } # Reset when we hit the next section
138+
/^This PR contains all changes/ { p=0; next }
139+
!in_since && p { print }
140+
')
141+
142+
# For debugging
143+
echo "Extracted PR content:"
144+
echo "$PR_CONTENT"
145+
134146
RELEASE_NOTES="${RELEASE_NOTES}${PR_CONTENT}"
135147
else
136148
# Generate release notes in markdown format for release body

scripts/update-since-tags.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,10 @@ function generateReleaseNotesSummary(results, isDryRun = false) {
174174
return '';
175175
}
176176

177+
// Only generate one section based on whether this is a dry run or not
177178
let summary = isDryRun ?
178-
'### 🔄 Pending `@since` Tag / Deprecation Updates\n\n' :
179-
'### `@since` Tag / Deprecation Updates\n\n';
179+
'### 🔄 Pending `@since` Tag / Deprecation Placeholder Updates\n\n' :
180+
'### `@since` Tag / Deprecation Placeholder Updates\n\n';
180181

181182
summary += isDryRun ?
182183
`The following ${results.totalUpdated} version placeholder${results.totalUpdated === 1 ? '' : 's'} will be updated during release:\n\n` :
@@ -191,14 +192,14 @@ function generateReleaseNotesSummary(results, isDryRun = false) {
191192
const relativePath = path.relative(process.cwd(), file);
192193
console.log(chalk.gray(`Processing file: ${file}`));
193194
console.log(chalk.gray(`Relative path: ${relativePath}`));
194-
summary += `- \`${relativePath}\` (${count} update${count === 1 ? '' : 's'})\n`;
195+
summary += `* \`${relativePath}\` (${count} update${count === 1 ? '' : 's'})\n`;
195196
});
196197

197198
if (results.errors.length > 0) {
198199
summary += '\n#### Errors\n\n';
199200
results.errors.forEach(({ file, error }) => {
200201
const relativePath = path.relative(process.cwd(), file);
201-
summary += `- Failed to ${isDryRun ? 'check' : 'update'} \`${relativePath}\`: ${error}\n`;
202+
summary += `* Failed to ${isDryRun ? 'check' : 'update'} \`${relativePath}\`: ${error}\n`;
202203
});
203204
}
204205

0 commit comments

Comments
 (0)