From 458efbce885823d9e3cf9478e48318e0b53276b1 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 12 Jul 2022 13:02:30 -0700 Subject: [PATCH 1/3] Make sure target and source branches are up-to-date --- .github/actions/composite/updateProtectedBranch/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/composite/updateProtectedBranch/action.yml b/.github/actions/composite/updateProtectedBranch/action.yml index 61c7719b242a..c7c10ce27a2d 100644 --- a/.github/actions/composite/updateProtectedBranch/action.yml +++ b/.github/actions/composite/updateProtectedBranch/action.yml @@ -51,11 +51,14 @@ runs: with: GPG_PASSPHRASE: ${{ inputs.GPG_PASSPHRASE }} - - name: Checkout source branch + - name: Update target and source branches shell: bash run: | - git fetch + git fetch --all + git checkout ${{ env.TARGET_BRANCH }} + git pull git checkout ${{ env.SOURCE_BRANCH }} + git pull - name: Set New Version shell: bash From f80de79aa05f8e02559904a9682989accbf73268 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 12 Jul 2022 13:12:22 -0700 Subject: [PATCH 2/3] Eliminate unnecessary network requests --- .github/actions/composite/updateProtectedBranch/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/composite/updateProtectedBranch/action.yml b/.github/actions/composite/updateProtectedBranch/action.yml index c7c10ce27a2d..b127b8bfa29f 100644 --- a/.github/actions/composite/updateProtectedBranch/action.yml +++ b/.github/actions/composite/updateProtectedBranch/action.yml @@ -56,9 +56,9 @@ runs: run: | git fetch --all git checkout ${{ env.TARGET_BRANCH }} - git pull + git merge origin/${{ env.TARGET_BRANCH }} git checkout ${{ env.SOURCE_BRANCH }} - git pull + git merge origin/${{ env.SOURCE_BRANCH }} - name: Set New Version shell: bash From 7ceed5b76cd5911cc256bcf384f5a71e5904c60d Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 12 Jul 2022 13:15:14 -0700 Subject: [PATCH 3/3] Remove unnecessary --all --- .github/actions/composite/updateProtectedBranch/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/composite/updateProtectedBranch/action.yml b/.github/actions/composite/updateProtectedBranch/action.yml index b127b8bfa29f..e4683029639f 100644 --- a/.github/actions/composite/updateProtectedBranch/action.yml +++ b/.github/actions/composite/updateProtectedBranch/action.yml @@ -54,7 +54,7 @@ runs: - name: Update target and source branches shell: bash run: | - git fetch --all + git fetch git checkout ${{ env.TARGET_BRANCH }} git merge origin/${{ env.TARGET_BRANCH }} git checkout ${{ env.SOURCE_BRANCH }}