Skip to content

Commit

Permalink
OPCT-192: Automatically create changelog based on the tags (#53)
Browse files Browse the repository at this point in the history
https://issues.redhat.com/browse/OPCT-192

The goal of this card is to automatically create the changelog based on
the commit standards.

The labels should be defined to fit OPCT project. The existing is
suggested, it would be nice to be adapted for the same used by OCP
projects
  • Loading branch information
mtulio committed Apr 10, 2023
1 parent 2958396 commit 18b3370
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
73 changes: 73 additions & 0 deletions .github/workflows/changelog-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature", "kind/feature"]
},
{
"title": "## 🛰 Design / API Change",
"labels": ["design", "kind/design", "kind/api-change"]
},
{
"title": "## 🐛 Fixes",
"labels": ["fix", "kind/bug"]
},
{
"title": "## 🧪 Tests",
"labels": ["test", "kind/flake", "kind/failing-test"]
},
{
"title": "## ⛏ Cleanup",
"labels": ["cleanup", "kind/cleanup"]
},
{
"title": "## 📦 Dependencies",
"labels": ["dependencies", "kind/dependency-change"]
},
{
"title": "## 📜 Documentation",
"labels": ["docs", "documentation", "kind/documentation"]
},
{
"title": "## 💬 Other",
"labels": ["other"]
}
],
"ignore_labels": [
"ignore"
],
"sort": {
"order": "ASC",
"on_property": "mergedAt"
},
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
"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"
}
],
"trim_values": false,
"max_tags_to_fetch": 200,
"max_pull_requests": 200,
"max_back_track_time_days": 365
}
15 changes: 14 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,26 @@ jobs:
env:
RELEASE_TAG: ${{ github.ref_name }}

- name: Release
# https://github.com/mikepenz/release-changelog-builder-action#configuration
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configuration: ".github/workflows/changelog-configuration.json"

# https://github.com/softprops/action-gh-release
- name: Create Release
uses: softprops/action-gh-release@v0.1.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
openshift-provider-cert*
body: |
## Changelog
${{steps.github_release.outputs.changelog}}
- name: Build Container and Release to Quay
env:
Expand Down

0 comments on commit 18b3370

Please sign in to comment.