From fb81059c23813678db51f1ee4be292f6b4ef416d Mon Sep 17 00:00:00 2001 From: hubster-bot Date: Tue, 16 Jul 2024 11:58:13 +0100 Subject: [PATCH] Update createchangelog.yml --- .github/workflows/createchangelog.yml | 39 ++++++++++++++++++++------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/createchangelog.yml b/.github/workflows/createchangelog.yml index 425d3048..461764ae 100644 --- a/.github/workflows/createchangelog.yml +++ b/.github/workflows/createchangelog.yml @@ -1,17 +1,36 @@ -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: Extract numeric version and update update.mb file + run: | + version="${{ github.event.release.tag_name }}" + version_numeric=$(echo $version | grep -o -E '[0-9.]+') + { + echo "## $version_numeric" + echo "Release name: ${{ github.event.release.name }}" + echo "Release body: ${{ github.event.release.body }}" + echo "" + cat docs/update.mb + } > temp_update.mb + mv temp_update.mb docs/update.mb + + - 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 for release ${{ github.event.release.tag_name }}" + git push