Skip to content

Commit

Permalink
Merge pull request #99 from Sifchain/ci/add-sync-upstream-ci-worfklow
Browse files Browse the repository at this point in the history
  • Loading branch information
monilpat authored Dec 12, 2024
2 parents 4dc61f6 + 617408e commit 7904617
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/sync-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Sync Fork with Upstream

on:
# Runs every day at 00:00 UTC
schedule:
- cron: "*/5 * * * *"

# Allow manual trigger
workflow_dispatch:

jobs:
sync:
name: Sync with upstream
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Add upstream remote
run: |
git remote add upstream https://github.com/ai16z/eliza.git
git remote -v
- name: Fetch upstream
run: git fetch upstream

- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Sync fork
run: |
git checkout main
git merge upstream/main
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge main into sif-dev
run: |
git fetch origin sif-dev
git checkout sif-dev
# Try to merge main into sif-dev
git merge main --strategy-option ours || {
# If there are conflicts, favor sif-dev changes
git merge --abort
git reset --hard
git merge -X ours main
}
git push origin sif-dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7904617

Please sign in to comment.