Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/changelog-preview-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Generate changelog preview

on:
workflow_call:
inputs:
cliff_config_url:
type: string
description: URL to a git-cliff configuration file
default: https://raw.githubusercontent.com/holochain/release-integration/refs/heads/main/pre-1.0-cliff.toml

jobs:
changelog-preview-comment:
runs-on: ubuntu-latest

steps:
- name: Checkout PR commits only
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
Comment thread
cdunster marked this conversation as resolved.
fetch-depth: ${{ github.event.pull_request.commits }}
sparse-checkout: ''
sparse-checkout-cone-mode: false

- name: Checkout all tags
run: git fetch --tags

- name: Install git-cliff
uses: taiki-e/install-action@v2
with:
tool: git-cliff@2.9.1

- name: Run git cliff
run: |
git cliff \
--bump \
--config-url="${{ inputs.cliff_config_url }}" \
--strip=all \
--output=PR_CHANGELOG.md

- name: Add changelog preview as comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment thread
cdunster marked this conversation as resolved.
run: |
gh pr comment ${{ github.event.pull_request.html_url }} \
--body="$(printf 'The following will be added to the changelog\n\n---\n\n'; cat PR_CHANGELOG.md)" \
--edit-last \
--create-if-none