Skip to content

Update Changelog

Update Changelog #29

name: Update Changelog
on:
release:
types: [published]
jobs:
generate-changelog:
runs-on: ubuntu-latest
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.KBOT_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
echo "${{ github.event.release.tag_name }}" > release-version.txt
echo "${{ github.event.release.html_url }}" > url.txt
- name: Upload artifact with release info
uses: actions/upload-artifact@v4
with:
name: release-info
path: release-version.txt
- name: Upload artifact with release url
uses: actions/upload-artifact@v4
with:
name: release-url
path: url.txt
- 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.KBOT_TOKEN }}