Skip to content

Commit 6140e07

Browse files
authored
fix workflow (#937)
1 parent 69f7728 commit 6140e07

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

.github/workflows/release-openshift.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,16 @@ jobs:
3737
VERSION: ${{ github.event.inputs.version }}
3838
REPOSITORY: ${{ matrix.repository }}
3939
run: |
40-
cd $REPOSITORY
40+
curl -L https://github.com/cli/cli/releases/download/v2.27.0/gh_2.27.0_linux_amd64.tar.gz -o ghcli.tar.gz
41+
tar --strip-components=1 -xf ghcli.tar.gz -C /usr/local
42+
43+
cd $REPOSITORY
44+
45+
# Sync fork
46+
gh auth setup-git
47+
gh repo set-default $REPOSITORY
48+
gh repo sync -b main
49+
4150
mkdir -p "${REPO_PATH}/${VERSION}"
4251
4352
cd ../../mongodb-atlas-kubernetes
@@ -69,26 +78,26 @@ jobs:
6978
REPOSITORY: ${{ matrix.repository }}
7079
IMAGE: quay.io/mongodb/mongodb-atlas-kubernetes-operator
7180
run: |
81+
curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/local/bin/yq && chmod +x /usr/local/bin/yq
82+
7283
# Reference to image
73-
REPO_DIGEST=$(docker inspect --format='{{ index .RepoDigests 0}}' "${IMAGE}":"${VERSION}")
74-
containerImage="quay.io/${REPO_DIGEST}"
75-
yq e -i '.metadata.annotations.containerImage = env(containerImage)' "${VERSION}"/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
76-
yq e -i '.spec.install.spec.deployments[0].spec.template.spec.containers[0].image = env(containerImage)' "${VERSION}"/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
84+
docker pull "${IMAGE}":"${VERSION}"
85+
export REPO_DIGEST=$(docker inspect --format='{{ index .RepoDigests 0}}' "${IMAGE}":"${VERSION}")
86+
87+
cd "$REPOSITORY/$REPO_PATH"
88+
yq e -i '.metadata.annotations.containerImage = env(REPO_DIGEST)' "${VERSION}"/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
89+
yq e -i '.spec.install.spec.deployments[0].spec.template.spec.containers[0].image = env(REPO_DIGEST)' "${VERSION}"/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
7790

7891
# Add skip range
7992
value='">=0.8.0"' yq e -i '.spec.skipRange = env(value)' "${VERSION}"/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
8093
- name: Push Changes & Open PR
8194
env:
8295
VERSION: ${{ github.event.inputs.version }}
8396
REPOSITORY: ${{ matrix.repository }}
84-
ASSIGNEES: priyolahiri,fabritsius,igor-karpukhin,sugar-pack,helderjs
97+
ASSIGNEES: igor-karpukhin,helderjs
8598
run: |
8699
cd "$REPOSITORY/$REPO_PATH"
87100
88-
# Sync fork
89-
gh auth setup-git
90-
gh repo sync -b main
91-
92101
# configure git user
93102
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
94103
git config --global user.name "github-actions[bot]"

0 commit comments

Comments
 (0)