forked from RocketPy-Team/RocketPy
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.32 KB
/
Copy pathsync-upstream.yml
File metadata and controls
46 lines (37 loc) · 1.32 KB
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
46
# .github/workflows/sync-upstream.yml
# Syncs your fork's default branch with the upstream repo daily.
# Also runs on manual trigger via workflow_dispatch.
#
# Setup:
# 1. Copy this file to .github/workflows/sync-upstream.yml in your fork
# 2. Set the UPSTREAM_REPO variable below to the upstream owner/repo
name: Sync fork with upstream
on:
schedule:
- cron: '0 12 * * *' # 5:00 AM PT daily
workflow_dispatch: # manual trigger from Actions tab
env:
UPSTREAM_REPO: RocketPy-Team/RocketPy # change per fork
BRANCH: master # change if upstream uses 'main'
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout fork
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
fetch-depth: 0
- name: Add upstream remote
run: git remote add upstream https://github.com/${{ env.UPSTREAM_REPO }}.git
- name: Fetch upstream
run: git fetch upstream ${{ env.BRANCH }}
- name: Rebase on upstream
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git rebase upstream/${{ env.BRANCH }}
- name: Push to fork
run: git push origin ${{ env.BRANCH }} --force-with-lease