1
0
Files
balatro-mod-index/.github/workflows/fetch-upstream-mods.yml
Workflow config file is invalid. Please check your config file: yaml: line 47: could not find expected ':'

67 lines
2.0 KiB
YAML

name: fetch upstream mod changes
on:
schedule:
- cron: "13,43 * * * *"
workflow_dispatch:
jobs:
replace-mods:
runs-on: ubuntu-latest
steps:
- name: Clone Gitea repo
run: |
rm -rf repo /tmp/upstream
git clone ssh://git@smallgit.dasguney.com:2222/skyline/balatro-mod-index.git repo
- name: Clone upstream GitHub repo
run: |
git clone https://github.com/skyline69/balatro-mod-index.git /tmp/upstream
- name: Replace mods directory
run: |
cd repo
rm -rf mods
cp -a /tmp/upstream/mods ./mods
- name: Append last-updated timestamp
run: |
cd repo
TIME_NOW=$(date +"%s")
git diff -z --name-only | grep -z meta.json | while IFS='' read -r -d '' file; do
jq --indent 2 '."last-updated" |= (. // '"$TIME_NOW"')' "$file" | sponge "$file"
done
- name: Commit and push
env:
GITEA_TOKEN: ${{ secrets.GT_TOKEN }}
run: |
cd repo
git config user.name "jim[bot]"
git config user.email "jim[bot]@users.noreply.github.com"
# Provide HTTP auth for both git and git-lfs
cat > ~/.netrc <<EOF
machine smallgit.dasguney.com
login skyline
password ${GITEA_TOKEN}
EOF
chmod 600 ~/.netrc
# Use direct Gitea HTTP endpoint (no nginx)
git remote set-url origin http://smallgit.dasguney.com:3000/skyline/balatro-mod-index.git
# Force git-lfs to use the same endpoint and disable locking checks
git config lfs.url "http://smallgit.dasguney.com:3000/skyline/balatro-mod-index.git/info/lfs"
git config lfs."http://smallgit.dasguney.com:3000/skyline/balatro-mod-index.git/info/lfs".locksverify false
# Ensure LFS hooks are consistent (or skip if not needed)
git lfs install --local || true
git add mods
if git commit -m "fetch upstream mod changes ($(date --utc +%Y%m%d_%H%M%SZ))"; then
git push origin main
fi