forked from rancher/partner-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.73 KB
/
sync-fork.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
46
#Author: Nefi Munoz <nmunoz@suse.com>
name: Sync Fork
on:
# schedule:
# Runs every day at midnight UTC
# - cron: '0 0 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout main-source branch
uses: actions/checkout@v3
with:
ref: main-source # branch you want to sync
repository: marcosbc/partner-charts # your forked repository URL
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch upstream changes for main-source branch
run: |
git remote add upstream https://github.com/rancher/partner-charts.git # URL of upstream repository
git fetch upstream main-source
- name: Merge upstream changes into main-source branch
run: |
git checkout main-source
git merge upstream/main-source --allow-unrelated-histories --no-edit
git push origin main-source
# - name: Checkout main branch
# uses: actions/checkout@v3
# with:
# ref: main # branch you want to sync
# repository: marcosbc/partner-charts # your forked repository URL
# - name: Fetch upstream changes for main branch
# run: |
# git remote add upstream https://github.com/rancher/partner-charts.git # URL of upstream repository
# git fetch upstream main
- name: Merge upstream changes into main branch
run: |
git fetch upstream main # this fetch is necessary here
git checkout main
git merge upstream/main --allow-unrelated-histories --no-edit
git push origin main