-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: rerun failed workflow runs automatically
- Loading branch information
1 parent
28094e9
commit 8859aa7
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
name: Rerun failed workflow runs automatically | ||
on: | ||
workflow_dispatch: {} | ||
schedule: | ||
- cron: "0 */1 * * *" # Hourly | ||
|
||
env: | ||
AQUA_GLOBAL_CONFIG: ${{ github.workspace }}/aqua-all.yaml | ||
AQUA_LOG_COLOR: always | ||
AQUA_CONFIG: ${{ github.workspace }}/aqua/update.yaml | ||
|
||
jobs: | ||
rerun: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
permissions: | ||
actions: write # To rerun a workflow run | ||
contents: read # To checkout a repository | ||
pull-requests: read # To list pull requests | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- run: bash scripts/rerun.sh | ||
env: | ||
GITHUB_TOKEN: ${{github.token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
d=$(date +%Y-%m-%d -d "4 day ago") | ||
|
||
shas=$(gh -R aquaproj/aqua-registry pr list \ | ||
-A "app/aquaproj-aqua-registry" \ | ||
-S "created:>=$d" \ | ||
--json headRefOid \ | ||
-q '.[].headRefOiddate +%Y:%m:%d -d "1 day ago"') | ||
|
||
for sha in $shas; do | ||
echo "sha: $sha" >&2 | ||
runids=$(gh -R aquaproj/aqua-registry run list \ | ||
-c "$sha" \ | ||
-s failure \ | ||
--json databaseId \ | ||
-q '.[].databaseId') | ||
for runid in $runids; do | ||
echo "runid: $runid" >&2 | ||
gh -R aquaproj/aqua-registry run rerun "$runid" --failed | ||
done | ||
done |