Initial Commit

This commit is contained in:
2026-03-05 19:25:06 +01:00
commit 2ab5548fa8
2 changed files with 85 additions and 0 deletions

78
.github/workflows/sync-release.yml vendored Normal file
View File

@@ -0,0 +1,78 @@
name: Sync Upstream Release
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch upstream release metadata
id: upstream
run: |
RELEASE=$(curl -sf https://api.github.com/repos/muxi1/switch-cheats-db/releases/latest)
TAG=$(echo "$RELEASE" | jq -r '.tag_name')
NAME=$(echo "$RELEASE" | jq -r '.name // empty')
BODY=$(echo "$RELEASE" | jq -r '.body // empty')
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
# name defaults to tag when upstream leaves it empty
if [ -z "$NAME" ]; then
echo "name=$TAG" >> "$GITHUB_OUTPUT"
else
echo "name=$NAME" >> "$GITHUB_OUTPUT"
fi
# body via file to preserve newlines
echo "$BODY" > /tmp/release_body.md
# collect asset download URLs
echo "$RELEASE" | jq -r '.assets[].browser_download_url' > /tmp/asset_urls.txt
- name: Check if release already exists
id: check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.upstream.outputs.tag }}"
if gh release view "$TAG" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Download assets
if: steps.check.outputs.exists == 'false'
run: |
mkdir -p /tmp/assets
while IFS= read -r url; do
echo "Downloading $url"
curl -fL -o "/tmp/assets/$(basename "$url")" "$url"
done < /tmp/asset_urls.txt
- name: Create release with assets
if: steps.check.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.upstream.outputs.tag }}"
NAME="${{ steps.upstream.outputs.name }}"
ASSET_ARGS=""
for f in /tmp/assets/*; do
ASSET_ARGS="$ASSET_ARGS $f"
done
gh release create "$TAG" \
--title "$NAME" \
--notes-file /tmp/release_body.md \
$ASSET_ARGS

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
**Cheats für OmniNX**
Diese Datenbank wird vom "Cheats-Updater" aus dem OmniNX Pack automatisch heruntergeladen und verarbeitet.
---
> **Hinweis:** Dieses Repository ist ein automatisch aktualisierter Mirror von [muxi1/switch-cheats-db](https://github.com/muxi1/switch-cheats-db).