Skip to content

Commit

Permalink
chore: copy most recent changelog entry when creating a release
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Feb 3, 2024
1 parent 54c8a97 commit 66e9c02
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,22 @@ jobs:
REDIS_URL: 'redis://localhost'
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Set LAST_CHANGELOG_ENTRY
run: |
# read from the first until the second header in the changelog file
# this assumes the formatting of the file
# and that this workflow is always running for the most recent entry in the file
LAST_CHANGELOG_ENTRY=$(awk '/^## /{if (flag) exit; flag=1} flag && /^##$/{exit} flag' CHANGELOG.md)
echo "LAST_CHANGELOG_ENTRY=$LAST_CHANGELOG_ENTRY" >> $GITHUB_ENV
- name: Create GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.COMMITTED_VERSION }}
release_name: ${{ env.COMMITTED_VERSION }}
body: ${{ env.LAST_CHANGELOG_ENTRY || 'see CHANGELOG.md' }}

create-pull-request:
name: Create main repo PR with new posthog-js version
Expand Down

0 comments on commit 66e9c02

Please sign in to comment.