From dfed9b979329191eef56f30025118be166d31a4b Mon Sep 17 00:00:00 2001 From: skyline Date: Wed, 24 Dec 2025 03:13:51 +0000 Subject: [PATCH] Update .github/workflows/fetch-upstream-mods.yml --- .github/workflows/fetch-upstream-mods.yml | 32 ++++++++--------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/fetch-upstream-mods.yml b/.github/workflows/fetch-upstream-mods.yml index baedb5ae..c50021f7 100644 --- a/.github/workflows/fetch-upstream-mods.yml +++ b/.github/workflows/fetch-upstream-mods.yml @@ -8,47 +8,37 @@ on: jobs: replace-mods: runs-on: ubuntu-latest - steps: - - name: Checkout current Gitea repo - uses: actions/checkout@v4 - with: - lfs: true - persist-credentials: false + - name: Clone Gitea repo via SSH + run: | + git clone ssh://git@smallgit.dasguney.com:2222/skyline/balatro-mod-index.git repo - name: Clone upstream GitHub repo run: | - rm -rf /tmp/upstream 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: Force correct SSH remote (custom port) - run: | - git remote set-url origin ssh://git@smallgit.dasguney.com:2222/skyline/balatro-mod-index.git - git remote -v - - - name: Disable LFS lock verification + - name: Commit and push run: | + cd repo + git config user.name 'jim[bot]' + git config user.email 'jim[bot]@users.noreply.github.com' git config lfs.locksverify false - git config --local lfs.locksverify false - - - name: Commit and push changes - run: | - git config --global user.name 'jim[bot]' - git config --global user.email 'jim[bot]@users.noreply.github.com' git add mods if git commit -m "fetch upstream mod changes ($(date --utc +%Y%m%d_%H%M%SZ))"; then - git push ssh://git@smallgit.dasguney.com:2222/skyline/balatro-mod-index.git main - fi + git push + fi \ No newline at end of file