mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
86f8d567b9
This reverts commit 5d3d47eeb5
.
40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
name: Update update.mb on Release
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
update-file:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get latest release and update update.mb file
|
|
run: |
|
|
# Fetch the latest release using GitHub CLI
|
|
latest_release=$(gh release view --json tagName,name,body --jq '{tag: .tagName, name: .name, body: .body}')
|
|
|
|
# Extract details
|
|
tag=$(echo "$latest_release" | jq -r '.tag')
|
|
name=$(echo "$latest_release" | jq -r '.name')
|
|
body=$(echo "$latest_release" | jq -r '.body')
|
|
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+')
|
|
|
|
# Append to update.mb
|
|
echo "## $version_numeric" >> docs/update.mb
|
|
echo "Release name: $name" >> docs/update.mb
|
|
echo "Release body: $body" >> docs/update.mb
|
|
echo "" >> 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 with latest release"
|
|
git push |