






















@@ -174,9 +174,9 @@ jobs:
174174 shift
175175176176 local before_json dispatch_output run_id status conclusion url
177- before_json="$(gh run list --workflow "$workflow" --event workflow_dispatch --limit 100 --json databaseId --jq '[.[].databaseId]')"
177+ before_json="$(gh run list --repo "$GITHUB_REPOSITORY" --workflow "$workflow" --event workflow_dispatch --limit 100 --json databaseId --jq '[.[].databaseId]')"
178178179- dispatch_output="$(gh workflow run "$workflow" --ref "$CHILD_WORKFLOW_REF" "$@" 2>&1)"
179+ dispatch_output="$(gh workflow run --repo "$GITHUB_REPOSITORY" "$workflow" --ref "$CHILD_WORKFLOW_REF" "$@" 2>&1)"
180180 printf '%s\n' "$dispatch_output"
181181 run_id="$(
182182 printf '%s\n' "$dispatch_output" |
@@ -187,7 +187,7 @@ jobs:
187187 if [[ -z "$run_id" ]]; then
188188 for _ in $(seq 1 60); do
189189 run_id="$(
190- BEFORE_IDS="$before_json" gh run list --workflow "$workflow" --event workflow_dispatch --limit 50 --json databaseId,createdAt \
190+ BEFORE_IDS="$before_json" gh run list --repo "$GITHUB_REPOSITORY" --workflow "$workflow" --event workflow_dispatch --limit 50 --json databaseId,createdAt \
191191 --jq 'map(select(.databaseId as $id | (env.BEFORE_IDS | fromjson | index($id) | not))) | sort_by(.createdAt) | reverse | .[0].databaseId // empty'
192192 )"
193193 if [[ -n "$run_id" ]]; then
@@ -207,28 +207,28 @@ jobs:
207207 cancel_child() {
208208 if [[ -n "${run_id:-}" ]]; then
209209 echo "Cancelling child workflow ${workflow}: ${run_id}" >&2
210- gh run cancel "$run_id" >/dev/null 2>&1 || true
210+ gh run cancel --repo "$GITHUB_REPOSITORY" "$run_id" >/dev/null 2>&1 || true
211211 fi
212212 }
213213 trap cancel_child EXIT INT TERM
214214215215 while true; do
216- status="$(gh run view "$run_id" --json status --jq '.status')"
216+ status="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json status --jq '.status')"
217217 if [[ "$status" == "completed" ]]; then
218218 break
219219 fi
220220 sleep 30
221221 done
222222 trap - EXIT INT TERM
223223224- conclusion="$(gh run view "$run_id" --json conclusion --jq '.conclusion')"
225- url="$(gh run view "$run_id" --json url --jq '.url')"
224+ conclusion="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json conclusion --jq '.conclusion')"
225+ url="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json url --jq '.url')"
226226 echo "${workflow} finished with ${conclusion}: ${url}"
227227 {
228228 echo "- ${workflow}: ${conclusion} (${url})"
229229 } >> "$GITHUB_STEP_SUMMARY"
230230 if [[ "$conclusion" != "success" ]]; then
231- gh run view "$run_id" --json jobs --jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | {name, conclusion, url}' || true
231+ gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json jobs --jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | {name, conclusion, url}' || true
232232 exit 1
233233 fi
234234 }
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。