Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Sync with Upstream

Sync with Upstream #3

name: Sync with Upstream
on:
schedule:
- cron: "0 * * * *" # Runs every hour, adjust the cron schedule as needed
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Forked Repo
uses: actions/checkout@v3
with:
repository: isabelle-pundix/FXSwap-TokenList
token: ${{ secrets.TOKEN }}
fetch-depth: 0
- name: Set Up Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Add Upstream Remote
run: git remote add upstream https://github.com/FunctionX-SG/FXSwap-TokenList.git
- name: Fetch Upstream Changes
run: git fetch upstream
- name: Check for Differences
id: diff
run: |
git fetch upstream main
git diff --exit-code upstream/main
continue-on-error: true
- name: Merge Upstream Changes
if: steps.diff.outcome != 'success'
run: |
git merge upstream/main
- name: Push Changes
if: steps.diff.outcome != 'success'
run: git push origin main
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}