blob: adf201f43b93326b23085fc90609db7f219fd6b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/bin/sh
set -xe
REQUEST_CI_LABEL="request-ci"
REQUEST_CI_FAILED_LABEL="request-ci-failed"
for pr in "$@"; do
gh pr edit "$pr" --remove-label "$REQUEST_CI_LABEL"
ci_started=yes
rm -f output;
ncu-ci run "$pr" >output 2>&1 || ci_started=no
cat output
if [ "$ci_started" = "no" ]; then
# Do we need to reset?
gh pr edit "$pr" --add-label "$REQUEST_CI_FAILED_LABEL"
# shellcheck disable=SC2154
cqurl="${GITHUB_SERVER_URL}/${OWNER}/${REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
body="<details><summary>Failed to start CI</summary><pre>$(cat output)</pre><a href='$cqurl'>$cqurl</a></details>"
echo "$body"
gh pr comment "$pr" --body "$body"
rm output
fi
done;
|