This commit is contained in:
1 file changed
+1
-1
@@ -56,7 +56,7 @@ jobs:
|
|||||||
while :; do
|
while :; do
|
||||||
RUNS=$(curl -sS -H "Authorization: token ${GITEA_TOKEN}" "${API}/repos/${REPO}/actions/tasks?limit=50&page=${PAGE}")
|
RUNS=$(curl -sS -H "Authorization: token ${GITEA_TOKEN}" "${API}/repos/${REPO}/actions/tasks?limit=50&page=${PAGE}")
|
||||||
TOTAL=$(echo "${RUNS}" | python3 -c "import json,sys; print(json.load(sys.stdin).get('total_count',0))")
|
TOTAL=$(echo "${RUNS}" | python3 -c "import json,sys; print(json.load(sys.stdin).get('total_count',0))")
|
||||||
echo "${RUNS}" | python3 -c "import json,sys; [print(r['url']) for r in json.load(sys.stdin).get('workflow_runs',[]) if r.get('status')=='failure']" | while read -r url; do
|
echo "${RUNS}" | python3 -c "import json,sys; [print(r['url']) for r in json.load(sys.stdin).get('workflow_runs',[]) if r.get('status') in ('failure','cancelled')]" | while read -r url; do
|
||||||
RUN_API=$(echo "${url}" | sed "s|${GITHUB_SERVER_URL}/\\(.*\\)/actions/runs/|${API}/repos/\\1/actions/runs/|")
|
RUN_API=$(echo "${url}" | sed "s|${GITHUB_SERVER_URL}/\\(.*\\)/actions/runs/|${API}/repos/\\1/actions/runs/|")
|
||||||
echo "删除失败 run: ${url}"
|
echo "删除失败 run: ${url}"
|
||||||
curl -sS -o /dev/null -X DELETE -H "Authorization: token ${GITEA_TOKEN}" "${RUN_API}"
|
curl -sS -o /dev/null -X DELETE -H "Authorization: token ${GITEA_TOKEN}" "${RUN_API}"
|
||||||
|
|||||||
Reference in new issue
Block a user