@@ -120,6 +120,18 @@ jobs:
120
120
uses : actions/checkout@v3
121
121
with :
122
122
repository : minio/minio
123
+ - name : Check-out matching MinIO branch
124
+ env :
125
+ GH_BRANCH : ${{ github.head_ref || github.ref_name }}
126
+ GH_PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
127
+ run : |
128
+ GH_PR_ACCOUNT=`echo $GH_PR_REPO | sed "s/\\/.*//"`
129
+ if [ ! -z "$GH_PR_ACCOUNT" ] && [ ! "$GH_PR_ACCOUNT" = "minio" ]; then
130
+ ALTREPO="https://github.com/$GH_PR_ACCOUNT/minio.git"
131
+ echo "Attempting to fetch $ALTREPO..."
132
+ git remote add alt $ALTREPO
133
+ (git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
134
+ fi
123
135
- name : Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
124
136
uses : actions/setup-go@v3
125
137
with :
@@ -817,6 +829,18 @@ jobs:
817
829
with :
818
830
repository : minio/minio
819
831
path : " minio_repository"
832
+ - name : Check-out matching MinIO branch
833
+ env :
834
+ GH_BRANCH : ${{ github.head_ref || github.ref_name }}
835
+ GH_PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
836
+ run : |
837
+ GH_PR_ACCOUNT=`echo $GH_PR_REPO | sed "s/\\/.*//"`
838
+ if [ ! -z "$GH_PR_ACCOUNT" ] && [ ! "$GH_PR_ACCOUNT" = "minio" ]; then
839
+ ALTREPO="https://github.com/$GH_PR_ACCOUNT/minio.git"
840
+ echo "Attempting to fetch $ALTREPO..."
841
+ git remote add alt $ALTREPO
842
+ (git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
843
+ fi
820
844
- uses : actions/cache@v3
821
845
id : minio-latest-cache
822
846
name : MinIO Latest Cache
@@ -910,6 +934,18 @@ jobs:
910
934
with :
911
935
repository : minio/minio
912
936
path : " minio_repository"
937
+ - name : Check-out matching MinIO branch
938
+ env :
939
+ GH_BRANCH : ${{ github.head_ref || github.ref_name }}
940
+ GH_PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
941
+ run : |
942
+ GH_PR_ACCOUNT=`echo $GH_PR_REPO | sed "s/\\/.*//"`
943
+ if [ ! -z "$GH_PR_ACCOUNT" ] && [ ! "$GH_PR_ACCOUNT" = "minio" ]; then
944
+ ALTREPO="https://github.com/$GH_PR_ACCOUNT/minio.git"
945
+ echo "Attempting to fetch $ALTREPO..."
946
+ git remote add alt $ALTREPO
947
+ (git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
948
+ fi
913
949
- uses : actions/cache@v3
914
950
id : minio-latest-cache
915
951
name : MinIO Latest Cache
@@ -981,6 +1017,24 @@ jobs:
981
1017
with :
982
1018
repository : minio/minio
983
1019
path : " minio_repository"
1020
+ - name : Check-out matching MinIO branch
1021
+ env :
1022
+ GH_BRANCH : ${{ github.head_ref || github.ref_name }}
1023
+ GH_PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
1024
+ run : |
1025
+ GH_PR_ACCOUNT=`echo $GH_PR_REPO | sed "s/\\/.*//"`
1026
+ if [ ! -z "$GH_PR_ACCOUNT" ] && [ ! "$GH_PR_ACCOUNT" = "minio" ]; then
1027
+ ALTREPO="https://github.com/$GH_PR_ACCOUNT/minio.git"
1028
+ echo "Attempting to fetch $ALTREPO..."
1029
+ git remote add alt $ALTREPO
1030
+ (git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
1031
+ fi
1032
+
1033
+ - name : Checkout proper minio/minio branch
1034
+ run : |
1035
+
1036
+ git checkout "${{ github.head_ref || github.ref_name }}" || echo "Okay, we'll stay on the master branch"
1037
+
984
1038
- uses : actions/cache@v3
985
1039
id : minio-latest-cache
986
1040
name : MinIO Latest Cache
0 commit comments