File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,17 @@ curl() {
5757# This will contain the artifacts we want.
5858# https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs
5959get_artifacts_url () {
60- curl -fsSL ' https://api.github.com/repos/cdr/code-server/actions/workflows/ci.yaml/runs?status=success&event=push' | jq -r " .workflow_runs[] | select(.head_sha == \" $( git rev-parse HEAD) \" ) | .artifacts_url" | head -n 1
60+ local head_sha
61+ local artifacts_url
62+ head_sha=$( git rev-parse HEAD)
63+ artifacts_url=$( curl -fsSL ' https://api.github.com/repos/cdr/code-server/actions/workflows/ci.yaml/runs?status=success&event=pull_request' | jq -r " .workflow_runs[] | select(.head_sha == \" $head_sha \" ) | .artifacts_url" | head -n 1)
64+ if [[ -z " $artifacts_url " ]]; then
65+ echo >&2 " ERROR: artifacts_url came back empty"
66+ echo >&2 " Check the get_artifacts_url function"
67+ exit 1
68+ fi
69+
70+ echo " $artifacts_url "
6171}
6272
6373# Grabs the artifact's download url.
You can’t perform that action at this time.
0 commit comments