Skip to content

Update Changelog

Update Changelog #41

name: Update Changelog
on:
release:
types: [published]
jobs:
generate-changelog:
runs-on: self-hosted
permissions:
contents: write
actions: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- name: Install github-changelog-generator
run: |
gem install github_changelog_generator
- name: Generate Changelog
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
github_changelog_generator --user konstructio --project konstruct-ui
- name: Extract release version
id: extract_version
run: |
echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Commit and Push Changes
run: |
git config user.name "konstruct-bot"
git config user.email "konstruct-bot@konstruct.io"
git fetch origin main
git checkout main
git add CHANGELOG.md
git commit -m "🚀 chore: update changelog for the version ${RELEASE_VERSION}" --no-verify
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Dispatch release
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-H "Content-Type: application/json" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{
"event_type": "release",
"client_payload": {
"version": "${{ github.event.release.tag_name }}",
"url": "${{ github.event.release.html_url }}"
}
}'