Skip to content

Update CHANGELOG.md

Update CHANGELOG.md #4

name: Update CHANGELOG.md
on:
workflow_dispatch:
jobs:
release:
# Only run this workflow from the trunk branch and when it's triggered by dmsnell OR adamziel
if: >
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
github.actor == 'bgrgicak' ||
github.actor == 'brandonpayton'
)
# Specify runner + deployment step
runs-on: ubuntu-latest
environment:
name: npm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Fetch trunk
shell: bash
run: git fetch origin trunk --depth=1
- name: 'Install bun (for the changelog)'
run: |
curl -fsSL https://bun.sh/install | bash
- name: Config git user
run: |
git config --global user.name "deployment_bot"
git config --global user.email "[email protected]"
git remote set-url origin https://${{ secrets.GH_ACTOR }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
- name: '✏️ Generate release changelog'
run: |
ls ./
PATH="${PATH}:${HOME}/.bun/bin" npm run changelog -- --version=current
- name: '📦 Commit and push changelog'
run: |
if [[ -n $(git status --porcelain CHANGELOG.md) ]]; then
git commit CHANGELOG.md -m "chore: update changelog"
git push origin HEAD:trunk
else
echo "No changes in CHANGELOG.md. Skipping commit and push."
fi