forked from Paroxity/portal
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.13 KB
/
sync.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
39
40
41
42
43
44
45
name: Sync with Upstream
on:
schedule:
- cron: '0 0 * * *' # Daily at midnight
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
persist-credentials: false
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/Paroxity/portal.git
- name: Fetch Upstream
run: git fetch upstream master
- name: Merge Upstream Changes
run: |
git checkout master
git merge upstream/master --strategy-option theirs --no-commit
git restore --source=HEAD --staged README.md .github/
if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m "Merge upstream changes"
fi
- name: Push Changes
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git push https://[email protected]/PixelRidge-Softworks/portal.git master