Skip to content

Generate changelog

Generate changelog #30

name: Generate changelog
on:
workflow_dispatch:
inputs:
starttag:
description: 'Start tag (e.g. "vX.Y.Z")'
required: true
endtag:
description: 'End tag (e.g. "vX.Y.Z")'
required: true
workflow_call:
inputs:
externalCall:
description: "To distinguish workflow_call from workflow_dispatch"
type: boolean
required: false
default: true
endtag:
required: true
type: string
outputs:
changelog:
description: "The generated changelog"
value: ${{ jobs.auto-generate-changelog.outputs.changelog }}
jobs:
generate-custom-changelog:
if: github.event_name == 'workflow_dispatch'
name: Gen notes ${{ github.event.inputs.starttag }} - ${{ github.event.inputs.endtag }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: read_config
run: echo "config=$(jq -c . .github/workflows/changelog-template.json)" >> $GITHUB_OUTPUT
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v5.1.0
with:
failOnError: true
fromTag: ${{ github.event.inputs.starttag }}
toTag: ${{ github.event.inputs.endtag }}
configurationJson: ${{ steps.read_config.outputs.config }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Write to file
id: write_changelog_file
run: |
echo "${{ steps.build_changelog.outputs.changelog }}" > changelog.md
- name: Upload changelog
uses: actions/upload-artifact@v4
with:
name: changelog.md
path: changelog.md
auto-generate-changelog:
if: ${{ inputs.externalCall }}
name: Gen ${{ inputs.endtag }} notes
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.build_changelog.outputs.changelog }}
steps:
- uses: actions/checkout@v4
- id: read_config
run: echo "config=$(jq -c . .github/workflows/changelog-template.json)" >> $GITHUB_OUTPUT
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v5.1.0
with:
failOnError: true
toTag: ${{ github.event.inputs.endtag }}
configurationJson: ${{ steps.read_config.outputs.config }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Write to file
id: write_changelog_file
run: |
echo "${{ steps.build_changelog.outputs.changelog }}" > changelog.md
- name: Upload changelog
uses: actions/upload-artifact@v4
with:
name: changelog.md
path: changelog.md