Adding fork sync to daily GH action

pull/811/head
Nefi Munoz 2023-07-05 12:41:27 -06:00
parent 34a7e6e149
commit ab72bc89bc
1 changed files with 29 additions and 1 deletions

View File

@ -8,9 +8,37 @@ on:
# - main-source
jobs:
build:
sync: #this job should run first
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-source branch
run: |
git checkout main-source
git merge upstream/main-source --allow-unrelated-histories --no-edit
git push origin main-source
- 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
build:
needs: sync #this job should run after "sync" job
runs-on: ubuntu-latest
steps:
- name: Checkout main-source branch
uses: actions/checkout@v3