Skip to content

Sync Fork with Upstream #299

Sync Fork with Upstream

Sync Fork with Upstream #299

Workflow file for this run

name: Sync Fork with Upstream
on:
schedule:
- cron: '0 0 * * *' # Schedule the workflow to run daily, you can customize the schedule
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure upstream remote
run: |
git remote add upstream https://github.com/nhost/nhost.git
git fetch upstream
- name: Merge upstream changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "Sync Fork"
git checkout main
commit_hash=$(git rev-parse HEAD)
git merge --allow-unrelated-histories -X theirs upstream/main -m "Merge upstream changes"
git reset --soft $commit_hash
git restore --staged .github
git commit -m "Merge upstream changes"
git push origin main