Skip to content

Commit 2a7d061

Browse files
desrosjclaude
andcommitted
Build/Test Tools: Replace __OLD_SHA__ and fix the templated changelog sections.
- Add a step to substitute the new __OLD_SHA__ placeholder. - Rename the first details summary to "Changes" (it holds the commit list and source link); the second remains "Changelog" for the release notes. - For version branches, remove the entire changelog <details> block rather than just the placeholder line, so the body has no empty collapsible. - Insert the release changelog directly now that the template supplies the <details> wrapper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f32fc63 commit 2a7d061

2 files changed

Lines changed: 35 additions & 12 deletions

File tree

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
Updates the bundled Gutenberg commit reference for `__BRANCH__` to `__NEW_SHA__`.
1+
This updates the pinned Gutenberg repository commit hash for `__BRANCH__` from `__OLD_SHA__` to `__NEW_SHA__`.
2+
3+
<details>
4+
<summary>Changes</summary>
25

36
__COMMIT_LIST__
47

58
__SOURCE_LINE__
69

10+
</details>
11+
12+
<details>
13+
<summary>Changelog</summary>
14+
715
__CHANGELOG__
16+
17+
</details>

‎.github/workflows/gutenberg-sync.yml‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ jobs:
297297
run: |
298298
sed -i "s|__NEW_SHA__|${NEW_SHA}|g" pr_body.md
299299
300+
- name: Add the old SHA to the body
301+
env:
302+
OLD_SHA: ${{ needs.research.outputs.old-sha }}
303+
run: |
304+
sed -i "s|__OLD_SHA__|${OLD_SHA}|g" pr_body.md
305+
300306
- name: Add the list of changes to the body
301307
run: |
302308
awk '/__COMMIT_LIST__/ { while ( ( getline line < "commit_list.md" ) > 0 ) print line; close( "commit_list.md" ); next } 1' pr_body.md > pr_body.tmp
@@ -321,21 +327,28 @@ jobs:
321327
- name: Add the changelog to the body (trunk only)
322328
if: ${{ inputs.branch == 'trunk' }}
323329
run: |
324-
{
325-
echo "<details>"
326-
echo "<summary>Changelog</summary>"
327-
echo ""
328-
cat release_changelog.md
329-
echo ""
330-
echo "</details>"
331-
} > changelog_block.md
332-
awk '/__CHANGELOG__/ { while ( ( getline line < "changelog_block.md" ) > 0 ) print line; close( "changelog_block.md" ); next } 1' pr_body.md > pr_body.tmp
330+
awk '/__CHANGELOG__/ { while ( ( getline line < "release_changelog.md" ) > 0 ) print line; close( "release_changelog.md" ); next } 1' pr_body.md > pr_body.tmp
333331
mv pr_body.tmp pr_body.md
334332
335-
- name: Remove the changelog placeholder (version branches)
333+
- name: Remove the changelog section (version branches)
336334
if: ${{ inputs.branch != 'trunk' }}
337335
run: |
338-
sed -i '/__CHANGELOG__/d' pr_body.md
336+
# Version branches have no release changelog, so drop the whole
337+
# <details> block that contains the __CHANGELOG__ placeholder.
338+
awk '
339+
/^<details>$/ { block = $0 ORS; in_block = 1; drop = 0; next }
340+
in_block {
341+
block = block $0 ORS
342+
if ( $0 ~ /__CHANGELOG__/ ) { drop = 1 }
343+
if ( $0 == "</details>" ) {
344+
if ( ! drop ) { printf "%s", block }
345+
in_block = 0
346+
}
347+
next
348+
}
349+
{ print }
350+
' pr_body.md > pr_body.tmp
351+
mv pr_body.tmp pr_body.md
339352
340353
- name: Output pull request details
341354
env:

0 commit comments

Comments
 (0)