Skip to content

Commit 9eb7bbb

Browse files
authored
[ci] tuf-repo: more curl flags fun (#3384)
ci: use --netrc for downloading hubris artifacts as well An actions scope is needed to download artifacts from the Github API. Pass `--netrc` to use the buildomat provided API key as we do for the other curl invocations. ci: tuf-repo: harden curl invocations Some useful flags for curl in a scripted context: -f fail on server errors -s silent mode -S show error on failure -L follow redirects
1 parent 6642158 commit 9eb7bbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/buildomat/jobs/tuf-repo.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ done
137137

138138
# Fetch SP images from oxidecomputer/hubris GHA artifacts.
139139
HUBRIS_VERSION="1.0.0-alpha+git${HUBRIS_COMMIT:0:11}"
140-
run_id=$(curl --netrc "https://api.github.com/repos/oxidecomputer/hubris/actions/runs?head_sha=$HUBRIS_COMMIT" \
140+
run_id=$(curl --netrc -fsS "https://api.github.com/repos/oxidecomputer/hubris/actions/runs?head_sha=$HUBRIS_COMMIT" \
141141
| /opt/ooce/bin/jq -r '.workflow_runs[] | select(.path == ".github/workflows/dist.yml") | .id')
142-
artifacts=$(curl --netrc "https://api.github.com/repos/oxidecomputer/hubris/actions/runs/$run_id/artifacts")
142+
artifacts=$(curl --netrc -fsS "https://api.github.com/repos/oxidecomputer/hubris/actions/runs/$run_id/artifacts")
143143
for noun in gimlet-c psc-b sidecar-b; do
144144
tufaceous_kind=${noun%-?}
145145
tufaceous_kind=${tufaceous_kind//sidecar/switch}_sp
146146
job_name=dist-ubuntu-latest-$noun
147147
url=$(/opt/ooce/bin/jq --arg name "$job_name" -r '.artifacts[] | select(.name == $name) | .archive_download_url' <<<"$artifacts")
148-
curl -L -o /work/$job_name.zip "$url"
148+
curl --netrc -fsSL -o /work/$job_name.zip "$url"
149149
cat >>/work/manifest.toml <<EOF
150150
[artifact.$tufaceous_kind]
151151
name = "$tufaceous_kind"

0 commit comments

Comments
 (0)