From 445a4aeb6db75d8318d74769ee4f3887abd09bcf Mon Sep 17 00:00:00 2001 From: gordsport <83510148+gordsport@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:40:21 +0100 Subject: [PATCH] feat: Add changelog generator (#43) * feat: Add changelog generator closes #42 * chore: update labeling * fix: spelling error --- .github/workflows/changelog.yml | 35 +++++++++ .github/workflows/config/changelogconfig.json | 71 +++++++++++++++++++ CHANGELOG.md | 3 + wordlist.txt | 1 + 4 files changed, 110 insertions(+) create mode 100644 .github/workflows/changelog.yml create mode 100644 .github/workflows/config/changelogconfig.json create mode 100644 CHANGELOG.md diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..007bca8 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,35 @@ +--- + + +name: 'Change Log' +"on": + push: + tags: + - '*' + +jobs: + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + + - name: "Build Changelog" + id: github_release + uses: mikepenz/release-changelog-builder-action@v3 + with: + configuration: "config/changelogconfig.json" + ignorePreReleases: "true" + fromTag: "0.0.1" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: 'Create Release' + uses: actions/create-release@v3 + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: ${{steps.github_release.outputs.changelog}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/config/changelogconfig.json b/.github/workflows/config/changelogconfig.json new file mode 100644 index 0000000..0fc34c9 --- /dev/null +++ b/.github/workflows/config/changelogconfig.json @@ -0,0 +1,71 @@ +{ + "categories": [ + { + "title": "## ๐Ÿšจ Breaking Changes", + "labels": ["breaking"] + }, + { + "title": "## ๐Ÿš€ Features", + "labels": ["enhancement"] + }, + { + "title": "## ๐Ÿ› Fixes", + "labels": ["bug"] + }, + { + "title": "## ๐Ÿงช Tests", + "labels": ["tests"] + }, + { + "title": "## ๐Ÿช„ Magic", + "labels": ["mega", "magic"], + "exhaustive": true, + } + ], + "ignore_labels": [ + "wontfix", "no-issue", "duplicate" + ], + "sort": { + "order": "ASC", + "on_property": "mergedAt" + }, + "template": "${{CHANGELOG}}\n\n
\nUncategorized\n\n${{UNCATEGORIZED}}\n
", + "pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}", + "empty_template": "- no changes", + "label_extractor": [ + { + "pattern": "(.) (.+)", + "target": "$1", + "flags": "gu" + }, + { + "pattern": "\\[Issue\\]", + "on_property": "title", + "method": "match" + } + ], + "duplicate_filter": { + "pattern": "\\[ABC-....\\]", + "on_property": "title", + "method": "match" + }, + "transformers": [ + { + "pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)", + "target": "- $4\n - $6" + } + ], + "max_tags_to_fetch": 200, + "max_pull_requests": 200, + "max_back_track_time_days": 365, + "tag_resolver": { + "method": "semver", + "filter": { + "pattern": "api-(.+)", + "flags": "gu" + } + }, + "base_branches": [ + "main" + ] +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..76769e7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# Changelog + +You can find a detailed change log in the [release section](https://github.com/theteamworks/project-board-automation/releases) diff --git a/wordlist.txt b/wordlist.txt index f783f87..8140565 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -1,3 +1,4 @@ +Changelog GitHub GraphQL WIP \ No newline at end of file