name: Post release
on:
  release:
    types:
      - released
  workflow_dispatch:

jobs:
  changelog:
    name: Update changelog
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: main
      - uses: rhysd/changelog-from-release/action@v3
        with:
          file: CHANGELOG.md
          github_token: ${{ secrets.GITHUB_TOKEN }}
          commit_summary_template: 'update changelog for %s changes'