Skip to content

Commit 3ea4a03

Browse files
committed
Provide workaround for circular dependency
1 parent f1524b0 commit 3ea4a03

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/jobs.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ jobs:
120120
uses: actions/checkout@v3
121121
with:
122122
repository: minio/minio
123+
- name: Check-out matching MinIO branch
124+
env:
125+
GH_OWNER: ${{ github.repository_owner }}
126+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
127+
run: |
128+
if [ ! "$GH_OWNER" = "minio" ]; then
129+
ALTREPO="https://github.com/$GH_OWNER/minio.git"
130+
echo "Attempting to fetch $ALTREPO..."
131+
git remote add alt $ALTREPO
132+
(git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
133+
fi
123134
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
124135
uses: actions/setup-go@v3
125136
with:
@@ -817,6 +828,18 @@ jobs:
817828
with:
818829
repository: minio/minio
819830
path: "minio_repository"
831+
- name: Check-out matching MinIO branch
832+
env:
833+
GH_OWNER: ${{ github.repository_owner }}
834+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
835+
run: |
836+
cd minio_repository
837+
if [ ! "$GH_OWNER" = "minio" ]; then
838+
ALTREPO="https://github.com/$GH_OWNER/minio.git"
839+
echo "Attempting to fetch $ALTREPO..."
840+
git remote add alt $ALTREPO
841+
(git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
842+
fi
820843
- uses: actions/cache@v3
821844
id: minio-latest-cache
822845
name: MinIO Latest Cache
@@ -910,6 +933,18 @@ jobs:
910933
with:
911934
repository: minio/minio
912935
path: "minio_repository"
936+
- name: Check-out matching MinIO branch
937+
env:
938+
GH_OWNER: ${{ github.repository_owner }}
939+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
940+
run: |
941+
cd minio_repository
942+
if [ ! "$GH_OWNER" = "minio" ]; then
943+
ALTREPO="https://github.com/$GH_OWNER/minio.git"
944+
echo "Attempting to fetch $ALTREPO..."
945+
git remote add alt $ALTREPO
946+
(git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
947+
fi
913948
- uses: actions/cache@v3
914949
id: minio-latest-cache
915950
name: MinIO Latest Cache
@@ -981,6 +1016,24 @@ jobs:
9811016
with:
9821017
repository: minio/minio
9831018
path: "minio_repository"
1019+
- name: Check-out matching MinIO branch
1020+
env:
1021+
GH_OWNER: ${{ github.repository_owner }}
1022+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
1023+
run: |
1024+
cd minio_repository
1025+
if [ ! "$GH_OWNER" = "minio" ]; then
1026+
ALTREPO="https://github.com/$GH_OWNER/minio.git"
1027+
echo "Attempting to fetch $ALTREPO..."
1028+
git remote add alt $ALTREPO
1029+
(git fetch alt && git checkout "alt/$GH_BRANCH") || echo "$ALTREPO ($GH_BRANCH) not available, so keeping default repository/branch"
1030+
fi
1031+
1032+
- name: Checkout proper minio/minio branch
1033+
run: |
1034+
1035+
git checkout "${{ github.head_ref || github.ref_name }}" || echo "Okay, we'll stay on the master branch"
1036+
9841037
- uses: actions/cache@v3
9851038
id: minio-latest-cache
9861039
name: MinIO Latest Cache

0 commit comments

Comments
 (0)