/ .github / workflows / changelog.yaml
changelog.yaml
 1  # Generate and commit CHANGELOG.md on every push to main/master (including PR merges).
 2  # Skips commits made by github-actions[bot] to avoid infinite loops.
 3  
 4  name: changelog
 5  
 6  on:
 7    push:
 8      branches: [main, master]
 9  
10  jobs:
11    changelog:
12      runs-on: ubuntu-latest
13      permissions:
14        contents: write
15      if: github.actor != 'github-actions[bot]'
16  
17      steps:
18        - name: Checkout
19          uses: actions/checkout@v4
20          with:
21            fetch-depth: 0
22  
23        - name: Install Devbox and project dependencies
24          uses: jetify-com/devbox-install-action@v0.14.0
25  
26        - name: Generate changelog
27          run: |
28            git config user.name "github-actions[bot]"
29            git config user.email "github-actions[bot]@users.noreply.github.com"
30            devbox run -- task changelog
31            if git diff --staged --quiet; then
32              echo "No changelog changes to commit"
33            else
34              git commit -m "chore: update CHANGELOG.md [skip ci]"
35              git push origin ${GITHUB_REF#refs/heads/}
36            fi