Skip to content

Add clause for git cliff to ignore CI commits. Automate changelog generation, see example #43

@marcelocra

Description

@marcelocra

For a rust project:

name: Update Changelog

on:
  workflow_dispatch:  # Manual trigger
  push:
    branches:
      - main
    paths:
      - 'src/**'
      - 'Cargo.toml'
      - 'Cargo.lock'

permissions:
  contents: write

jobs:
  changelog:
    name: Generate Changelog
    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          
      - name: Install git-cliff
        run: cargo install git-cliff --version 2.7.0
        
      - name: Generate Changelog
        run: git cliff -o CHANGELOG.md
        
      - name: Commit Changelog
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"
          git add CHANGELOG.md
          git diff --staged --quiet || git commit -m "ci: update CHANGELOG.md"
          git push

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions