File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,17 @@ curl() {
57
57
# This will contain the artifacts we want.
58
58
# https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs
59
59
get_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
+ >&2 echo " ERROR: artifacts_url came back empty"
66
+ >&2 echo " Check the get_artifacts_url function"
67
+ exit 1
68
+ fi
69
+
70
+ echo " $artifacts_url "
61
71
}
62
72
63
73
# Grabs the artifact's download url.
You can’t perform that action at this time.
0 commit comments