Sync Fork with Upstream #230
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync Fork with Upstream | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- main | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Fork Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Add Upstream Remote | |
run: git remote add upstream https://github.com/COS301-SE-2024/ECHO.git | |
- name: Fetch Upstream Changes | |
run: git fetch upstream | |
- name: Set Up Git Identity | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Merge Upstream Changes | |
run: git merge upstream/main --allow-unrelated-histories | |
- name: Push Changes to Fork | |
run: git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |