Fixes an issue with create changelog not working (#2375)

* Update createchangelog.yml

* Update createchangelog.yml
This commit is contained in:
Real-MullaC 2024-07-16 16:55:30 +01:00 committed by GitHub
parent 594ee94f49
commit ad9cc6fffd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,17 +1,41 @@
name: On release published name: Update update.mb on Release
on: on:
release: release:
types: [published] types: [published]
jobs: jobs:
changelog: update-file:
name: Update changelog
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - name: Checkout Repository
with: uses: actions/checkout@v2
ref: main
- uses: rhysd/changelog-from-release/action@v3 - name: Get all releases and update update.mb file
with: run: |
file: /docs/updates.md # Fetch all releases using GitHub CLI
github_token: ${{ secrets.GITHUB_TOKEN }} gh release list --limit 1000 > releases.txt
# Extract numeric versions and create update.mb content
echo "" > docs/update.mb
while read -r line; do
tag=$(echo "$line" | awk '{print $1}')
name=$(echo "$line" | awk -F'\t' '{print $2}')
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+')
body=$(gh release view "$tag" --json body --jq .body)
echo "## $version_numeric" >> docs/update.mb
echo "Release name: $name" >> docs/update.mb
echo "Release body: $body" >> docs/update.mb
echo "" >> docs/update.mb
done < releases.txt
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/update.mb
git commit -m "Update update.mb with all releases"
git push