From bc17f1667bf935cdd3c4abf8be711e27e53c13ef Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 30 Jul 2026 21:03:40 -0300 Subject: [PATCH] retry failed night tests --- .github/workflows/nightly_retry.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/nightly_retry.yml diff --git a/.github/workflows/nightly_retry.yml b/.github/workflows/nightly_retry.yml new file mode 100644 index 00000000..5110abe0 --- /dev/null +++ b/.github/workflows/nightly_retry.yml @@ -0,0 +1,23 @@ +name: Retry failed nightly jobs +on: + schedule: + - cron: '17 2 * * *' + workflow_dispatch: +permissions: + actions: write +jobs: + retry: + runs-on: ubuntu-latest + steps: + - env: + GH_TOKEN: ${{ github.token }} + run: | + min=$(date -u -d '4 hours ago' +%s) + max=$(date -u -d '2 hours ago' +%s) + gh api --paginate "/repos/$GITHUB_REPOSITORY/actions/workflows/nightly.yml/runs?status=failure&per_page=100" --jq '.workflow_runs[] | select(.run_attempt == 1) | [.id, .updated_at] | @tsv' | + while IFS=$'\t' read -r id updated; do + when=$(date -u -d "$updated" +%s) + if [ "$when" -ge "$min" ] && [ "$when" -le "$max" ]; then + gh api --method POST "/repos/$GITHUB_REPOSITORY/actions/runs/$id/rerun-failed-jobs" + fi + done