Skip to content

Commit da132c3

Browse files
CCM-11942 Updating script with debug info
1 parent 47b4fe8 commit da132c3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,14 @@ workflow_run_url=$(curl -s -L \
176176
end
177177
| .url')
178178

179-
180179
if [[ -n "$workflow_run_url" && "$workflow_run_url" != null ]]; then
181-
# Get the latest GHA run of this combination of parameters
180+
# Workflow_run_url is a list of all workflows which were run for this combination of inputs, but are the API uri
181+
# take the first and strip it back to being an accessible url
182+
# Example https://api.github.com/repos/MyOrg/my-repo/actions/runs/12346789 becomes
183+
# becomes https://github.com/MyOrg/my-repo/actions/runs/12346789
182184
workflow_run_url=$(echo "$workflow_run_url" | head -n 1)
185+
workflow_run_url=${workflow_run_url/api./} # strips the api. prefix
186+
workflow_run_url=${workflow_run_url/\/repos/} # strips the repos/ uri
183187
echo "[INFO] Found workflow run url: $workflow_run_url"
184188
break
185189
fi
@@ -191,8 +195,6 @@ done
191195
if [[ -z "$workflow_run_url" || "$workflow_run_url" == null ]]; then
192196
echo "[ERROR] Failed to get the workflow run url. Exiting."
193197
exit 1
194-
else
195-
echo "[INFO] Found workflow run url: $workflow_run_url"
196198
fi
197199

198200
# Wait for workflow completion

0 commit comments

Comments
 (0)