Add GitHub sync workflow (every 6h)
Some checks failed
Build pokemon-or-military / build (push) Failing after 35s
Some checks failed
Build pokemon-or-military / build (push) Failing after 35s
This commit is contained in:
parent
89182a1b24
commit
b890f691fc
1 changed files with 36 additions and 0 deletions
36
.forgejo/workflows/sync.yaml
Normal file
36
.forgejo/workflows/sync.yaml
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue