From ab72bc89bcbb6f5c88fbc59a6971865c64895387 Mon Sep 17 00:00:00 2001 From: Nefi Munoz Date: Wed, 5 Jul 2023 12:41:27 -0600 Subject: [PATCH] Adding fork sync to daily GH action --- .github/workflows/daily.yaml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index 4a7a8c174..1d664e1d7 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -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