Skip to content

Update Version Information #1436

Update Version Information

Update Version Information #1436

name: Update Version Information
on:
push:
branches:
- main
paths:
- 'update_version_info.sh'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
Update:
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
steps:
- name: Git checkout
uses: actions/checkout@v6
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y git perl curl
- name: Update version information
run: bash ./update_version_info.sh
- name: Commit and push changes
id: push_changes
run: |
if git diff --quiet; then
echo "pushed=false" >>"$GITHUB_OUTPUT"
exit 0
fi
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add README.md versions/*.version versions/*.hash
git commit -m "Update tracked upstream versions"
git push
echo "pushed=true" >>"$GITHUB_OUTPUT"
- name: Dispatch Release Packages
if: steps.push_changes.outputs.pushed == 'true'
run: |
curl -fsSL \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/main.yml/dispatches" \
-d '{"ref":"main"}'