Skip to content

Update Self-Hosted Changelog #37

Update Self-Hosted Changelog

Update Self-Hosted Changelog #37

name: Update Self-Hosted Changelog
on:
# Run daily at 06:00 UTC
schedule:
- cron: "0 6 * * *"
# Allow manual runs
workflow_dispatch:
# Allow the monorepo to trigger this via repository_dispatch
# e.g.: gh api repos/tembo-io/docs/dispatches -f event_type=release-published
repository_dispatch:
types: [release-published]
jobs:
update-changelog:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Regenerate changelog
env:
GITHUB_TOKEN: ${{ secrets.MONOREPO_READ_TOKEN }}
run: node scripts/update-changelog.mjs
- name: Commit and open PR if changed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add features/self-hosted/changelog.mdx
if git diff --cached --quiet; then
echo "No changes to commit."
else
BRANCH="chore/changelog-update-$(date +%Y%m%d%H%M%S)"
git checkout -b "$BRANCH"
git commit -m "chore(changelog): update self-hosted release notes"
git push origin "$BRANCH"
gh pr create \
--title "chore(changelog): update self-hosted release notes" \
--body "Automated changelog update from the self-hosted release pipeline." \
--base main \
--head "$BRANCH"
fi