forked from devangpradhan/GSDM
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 936 Bytes
/
sync-repo.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Sync Repository
on:
schedule:
- cron: '0 * * * *' # Runs every hour at minute 0
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for accurate merge
- name: Set up Git
run: |
git config user.name "devangprdhan"
git config user.email "[email protected]"
- name: Add upstream remote
run: |
git remote add upstream https://github.com/<original-owner>/<original-repo>.git
- name: Fetch upstream changes
run: |
git fetch upstream
- name: Merge upstream changes
run: |
git checkout main
git merge upstream/main
- name: Push changes to the repository
run: |
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}