Update Changelog #52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Changelog | |
| on: | |
| # Runs every Friday at 2:00 PM UTC | |
| schedule: | |
| - cron: "0 13 * * 5" | |
| workflow_dispatch: # allows manual trigger | |
| jobs: | |
| changelog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run semantic-release | |
| run: npx semantic-release --dry-run | |
| - name: Bump version using semantic-release prediction | |
| id: bump | |
| run: | | |
| NEXT_VERSION=$(npx semantic-release --dry-run | grep 'nextRelease version' | awk '{print $NF}') | |
| echo "Next version is $NEXT_VERSION" | |
| if [ -n "$NEXT_VERSION" ]; then | |
| npm version "$NEXT_VERSION" --no-git-tag-version | |
| else | |
| echo "No new release detected — skipping version bump." | |
| fi | |
| - name: Run changelog script | |
| run: npm run changelog | |
| - name: Commit changes | |
| id: commit | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| branch="chore/update-changelog-${{ github.run_id }}" | |
| echo "branch=$branch" >> $GITHUB_OUTPUT | |
| echo "✅ Saved branch name: $branch" | |
| git add . | |
| if git diff --quiet && git diff --staged --quiet; then | |
| echo "No changes to commit." | |
| else | |
| git commit -m "chore: update changelog [skip ci]" | |
| fi | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "chore: update changelog [skip ci]" | |
| branch: ${{ steps.commit.outputs.branch }} | |
| title: "chore: update changelog" | |
| body: "Automated changelog update for this week 🚀" | |
| labels: "automation, changelog" | |
| base: v3 |