Generate changelog #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate changelog | |
on: [ workflow_dispatch ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: github.repository == 'pinterest/ktlint' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 19 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Get last released version | |
run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV | |
- name: "Build Changelog" | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v4 | |
with: | |
fromTag: "${{ env.version }}" | |
# This Github action is run before building a new release. All PR's created after last release and between current HEAD are to be | |
# included | |
toTag: "HEAD" | |
configurationJson: | | |
{ | |
"template": "## Unreleased\n\n#{{CHANGELOG}}", | |
"categories": [ | |
{ | |
"title": "### 🚀 API Changes", | |
"labels": ["api changelog"] | |
}, | |
{ | |
"title": "### 🚀 Features", | |
"labels": ["feature changelog"], | |
"empty_content": "None" | |
}, | |
{ | |
"title": "### 🐛 Fixes", | |
"labels": ["fix changelog"], | |
"empty_content": "None" | |
}, | |
{ | |
"title": "### 📦 Dependencies", | |
"labels": ["dependency changelog"] | |
}, | |
{ | |
"title": "### 💬 Other", | |
"labels": [], | |
"exclude_labels": ["documentation", "exclude from changelog"] | |
} | |
], | |
"pr_template": "* #{{TITLE}}\n PR [##{{NUMBER}}](#{{URL}}), by @#{{AUTHOR}}", | |
"empty_template": "- no changes", | |
"sort": { | |
"order": "ASC", | |
"on_property": "mergedAt" | |
}, | |
"label_extractor": [ | |
{ | |
"pattern": "renovate\\[bot\\]", | |
"on_property": "author", | |
"method": "replace", | |
"target": "dependency changelog" | |
} | |
], | |
"max_pull_requests": 1000, | |
"max_back_track_time_days": 1000 | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: echo -e "${{ steps.build_changelog.outputs.changelog }}" |