Skip to content

Commit 8cedee2

Browse files
committed
ci(release): update workflow to use dynamic release body and automate changelog commits
- Use release-please output for release body instead of hardcoded template - Add step to commit CHANGELOG.md changes after release creation - Ensure changelog updates are pushed to main branch automatically
1 parent cce7142 commit 8cedee2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
release_created: ${{ steps.release.outputs.release_created }}
2525
tag_name: ${{ steps.release.outputs.tag_name }}
2626
version: ${{ steps.release.outputs.version }}
27+
body: ${{ steps.release.outputs.body }}
2728

2829
steps:
2930
- name: Run release-please
@@ -83,25 +84,24 @@ jobs:
8384
with:
8485
tag_name: ${{ needs.release-please.outputs.tag_name }}
8586
name: Release ${{ needs.release-please.outputs.tag_name }}
86-
body: |
87-
## What's Changed
88-
89-
This release was automatically created by [release-please](https://github.com/googleapis/release-please).
90-
91-
### Installation
92-
93-
**From VS Code Marketplace:**
94-
```
95-
code --install-extension hitclaw.diffy-explain-ai
96-
```
97-
98-
**Or download the VSIX file** from the assets below and install manually.
87+
body: ${{ needs.release-please.outputs.body }}
9988
files: diffy-explain-ai-${{ needs.release-please.outputs.version }}.vsix
10089
draft: false
10190
prerelease: false
10291
env:
10392
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10493

94+
- name: Commit CHANGELOG.md changes
95+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
96+
run: |
97+
git config --global user.name 'github-actions[bot]'
98+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
99+
git add CHANGELOG.md
100+
git commit -m "chore: release ${{ needs.release-please.outputs.tag_name }} [skip ci]" || echo "No changes to commit"
101+
git push origin main
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
105105
- name: Upload VSIX artifact
106106
uses: actions/upload-artifact@v4
107107
with:

0 commit comments

Comments
 (0)