OmniNX/.github/workflows/update-badge-data.yml
niklascfw e1fbb1bc7f
Move README badge data to .github/badges/data.json.
Keeps shields.io JSON under .github and updates the script, CI workflow, and README widget URLs.
2026-05-25 21:56:00 +02:00

45 lines
1.5 KiB
YAML

# Aktualisiert täglich .github/badges/data.json (Download-Summe, OmniNX-Version, kompatible FW = Tag des letzten Releases in OmniNX/NX_Firmware).
# Läuft auf Gitea Actions wie die übrigen Workflows (.github/workflows); github.api_url = Gitea-API.
name: Update badge-data
on:
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Regenerate badge data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
FIRMWARE_REPOSITORY: OmniNX/NX_Firmware
# Optional: PAT with read access if NX_Firmware is private (job token often 404s on other repos).
FIRMWARE_API_TOKEN: ${{ secrets.FIRMWARE_API_TOKEN }}
run: python3 scripts/update-badge-data.py
- name: Commit and push if changed
run: |
set -euo pipefail
git config user.name "OmniNX CI"
git config user.email "omninx-ci@users.noreply.git.niklascfw.de"
git add .github/badges/data.json
if git diff --staged --quiet; then
echo ".github/badges/data.json unverändert."
exit 0
fi
git commit -m "chore: refresh badge data [skip ci]"
git push