Add GitHub sync workflow (every 6h)
Some checks failed
Build pokemon-or-military / build (push) Failing after 35s

This commit is contained in:
joshii 2026-03-15 20:53:20 +01:00
parent 89182a1b24
commit b890f691fc

View file

@ -0,0 +1,36 @@
name: Sync from GitHub
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Clone repo
run: |
git clone https://git.joshuahirsig.xyz/docker/pokemon-or-military.git .
git config user.name "forgejo-bot"
git config user.email "bot@joshuahirsig.xyz"
- name: Fetch upstream
run: |
git remote add upstream https://github.com/mathieuviart/PokemonTCGSetOrMilitaryOperation.git
git fetch upstream main
- name: Check for changes
id: check
run: |
if git merge-base --is-ancestor upstream/main HEAD; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Merge and push
if: steps.check.outputs.changed == 'true'
run: |
git merge upstream/main --no-edit
git push https://joshii:${{ secrets.REGISTRY_TOKEN }}@git.joshuahirsig.xyz/docker/pokemon-or-military.git HEAD:main