Skip to content

Commit df7a020

Browse files
sutaakaropenshift-merge-robot
authored andcommitted
Use yq to modify the codeflare-notebook-imagestream.yaml for release
1 parent f614195 commit df7a020

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/tag-and-release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
with:
4444
go-version: v1.19
4545

46+
- name: Install yq
47+
run: |
48+
sudo wget -O /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.6.1/yq_linux_amd64
49+
sudo chmod +x /usr/bin/yq
50+
4651
- name: Verify that release doesn't exist yet
4752
shell: bash {0}
4853
run: |
@@ -71,9 +76,12 @@ jobs:
7176

7277
- name: Adjust CodeFlare notebook ImageStream
7378
run: |
74-
sed -i -E "s|(.*name: ).*|\1${{ github.event.inputs.codeflare-sdk-version }}|" codeflare-notebook-imagestream.yaml
75-
sed -i -E "s|(.*name: quay.io/project-codeflare/notebook:).*|\1${{ github.event.inputs.codeflare-sdk-version }}|" codeflare-notebook-imagestream.yaml
79+
yq eval '.spec.tags[0].name = strenv(CODEFLARE_SDK_VERSION)' -i codeflare-notebook-imagestream.yaml
80+
yq eval '.spec.tags[0].from.name = strenv(CODEFLARE_SDK_NOTEBOOK_IMAGE)' -i codeflare-notebook-imagestream.yaml
7681
working-directory: codeflare-stack/base
82+
env:
83+
CODEFLARE_SDK_VERSION: ${{ github.event.inputs.codeflare-sdk-version }}
84+
CODEFLARE_SDK_NOTEBOOK_IMAGE: "quay.io/project-codeflare/notebook:${{ github.event.inputs.codeflare-sdk-version }}"
7785

7886
- name: Commit changes in the code back to repository
7987
uses: stefanzweifel/git-auto-commit-action@v4

0 commit comments

Comments
 (0)