Create sync-fork.yml

pull/741/head
Nefi Munoz 2023-05-01 15:46:46 -06:00 committed by GitHub
parent 678fb6d707
commit 3dbdc99296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 47 additions and 0 deletions

47
.github/workflows/sync-fork.yml vendored Normal file
View File

@ -0,0 +1,47 @@
#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: nflondo/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 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: nflondo/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 develop branch
run: |
git checkout main
git merge upstream/main --allow-unrelated-histories --no-edit
git push origin main