Update .github/workflows/fetch-upstream-mods.yml
This commit is contained in:
32
.github/workflows/fetch-upstream-mods.yml
vendored
32
.github/workflows/fetch-upstream-mods.yml
vendored
@@ -8,47 +8,37 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
replace-mods:
|
replace-mods:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout current Gitea repo
|
- name: Clone Gitea repo via SSH
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
with:
|
git clone ssh://git@smallgit.dasguney.com:2222/skyline/balatro-mod-index.git repo
|
||||||
lfs: true
|
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Clone upstream GitHub repo
|
- name: Clone upstream GitHub repo
|
||||||
run: |
|
run: |
|
||||||
rm -rf /tmp/upstream
|
|
||||||
git clone https://github.com/skyline69/balatro-mod-index.git /tmp/upstream
|
git clone https://github.com/skyline69/balatro-mod-index.git /tmp/upstream
|
||||||
|
|
||||||
- name: Replace mods directory
|
- name: Replace mods directory
|
||||||
run: |
|
run: |
|
||||||
|
cd repo
|
||||||
rm -rf mods
|
rm -rf mods
|
||||||
cp -a /tmp/upstream/mods ./mods
|
cp -a /tmp/upstream/mods ./mods
|
||||||
|
|
||||||
- name: Append last-updated timestamp
|
- name: Append last-updated timestamp
|
||||||
run: |
|
run: |
|
||||||
|
cd repo
|
||||||
TIME_NOW=$(date +"%s")
|
TIME_NOW=$(date +"%s")
|
||||||
git diff -z --name-only | grep -z meta.json | while IFS='' read -r -d '' file; do
|
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"
|
jq --indent 2 '."last-updated" |= (. // '"$TIME_NOW"')' "$file" | sponge "$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Force correct SSH remote (custom port)
|
- name: Commit and push
|
||||||
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
|
|
||||||
run: |
|
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 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
|
git add mods
|
||||||
if git commit -m "fetch upstream mod changes ($(date --utc +%Y%m%d_%H%M%SZ))"; then
|
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
|
git push
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user