From ad9cc6fffd152a38384b0a19cd9b9f636bd4c2c9 Mon Sep 17 00:00:00 2001 From: Real-MullaC Date: Tue, 16 Jul 2024 16:55:30 +0100 Subject: [PATCH] Fixes an issue with create changelog not working (#2375) * Update createchangelog.yml * Update createchangelog.yml --- .github/workflows/createchangelog.yml | 44 +++++++++++++++++++++------ 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/createchangelog.yml b/.github/workflows/createchangelog.yml index 425d3048..212ba982 100644 --- a/.github/workflows/createchangelog.yml +++ b/.github/workflows/createchangelog.yml @@ -1,17 +1,41 @@ -name: On release published +name: Update update.mb on Release + on: release: types: [published] jobs: - changelog: - name: Update changelog + update-file: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - with: - ref: main - - uses: rhysd/changelog-from-release/action@v3 - with: - file: /docs/updates.md - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Get all releases and update update.mb file + run: | + # Fetch all releases using GitHub CLI + 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