Skip to content

Commit 1826b0a

Browse files
committed
chore: standardize yq installation in workflows
- Updated the yq installation steps in both peerpods-chart_image.yaml and publish-cohere-release.yaml to use a consistent method with version and checksum verification. - This change enhances security and reliability by ensuring the correct version of yq is installed and verified before use.
1 parent baec505 commit 1826b0a

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/peerpods-chart_image.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,15 @@ jobs:
6060
fetch-depth: 0
6161

6262
- name: Install yq
63+
# Keep in sync with the pin in publish-cohere-release.yaml.
64+
env:
65+
YQ_VERSION: v4.44.3
66+
YQ_SHA256: a2c097180dd884a8d50c956ee16a9cec070f30a7947cf4ebf87d5f36213e9ed7
6367
run: |
64-
echo "Installing yq..."
65-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
66-
sudo chmod +x /usr/local/bin/yq
68+
curl -fsSLo /tmp/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64"
69+
echo "${YQ_SHA256} /tmp/yq" | sha256sum --check --strict
70+
sudo install -m 0755 /tmp/yq /usr/local/bin/yq
71+
rm /tmp/yq
6772
yq --version
6873
6974
- name: Read versions from Chart.yaml and versions.yaml

.github/workflows/publish-cohere-release.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,16 @@ jobs:
185185
fetch-depth: 0
186186

187187
- name: Install yq
188+
# Keep in sync with the pin in peerpods-chart_image.yaml.
189+
env:
190+
YQ_VERSION: v4.44.3
191+
YQ_SHA256: a2c097180dd884a8d50c956ee16a9cec070f30a7947cf4ebf87d5f36213e9ed7
188192
run: |
189-
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
190-
sudo chmod +x /usr/local/bin/yq
193+
curl -fsSLo /tmp/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64"
194+
echo "${YQ_SHA256} /tmp/yq" | sha256sum --check --strict
195+
sudo install -m 0755 /tmp/yq /usr/local/bin/yq
196+
rm /tmp/yq
197+
yq --version
191198
192199
- name: Patch values.yaml with release image tags
193200
env:

0 commit comments

Comments
 (0)