Skip to content

Commit 061a67e

Browse files
committed
Cleanup scripts
1 parent d89ba9e commit 061a67e

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

.github/workflows/directory-listing.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
jobs:
77
pages-directory-listing:
8+
if: github.ref == 'refs/heads/data'
89
runs-on: ubuntu-latest
910
name: "Directory Listings Index"
1011
steps:
@@ -24,6 +25,7 @@ jobs:
2425
path: 'data' # upload generated folder
2526

2627
deploy:
28+
if: github.ref == 'refs/heads/data'
2729
needs: pages-directory-listing
2830
permissions:
2931
pages: write # to deploy to Pages

.github/workflows/watchdog.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This action recreate action for building stable images
2+
# This action restarts actions that failed - 3x
33
#
44
name: Watchdog (cronjob)
55
on:
@@ -8,9 +8,6 @@ on:
88
- cron: '*/15 * * * *'
99
workflow_dispatch:
1010

11-
env:
12-
GH_TOKEN: ${{ secrets.ACCESS_TOKEN_ARMBIANWORKER }}
13-
1411
concurrency:
1512
group: watchdog-${{ github.ref }}
1613
cancel-in-progress: true
@@ -24,10 +21,12 @@ jobs:
2421
matrix:
2522

2623
# list scripts you want to watch and execute failed jobs x-times
27-
script: ["generate-redirector-config","generate-base-files-info-json"]
24+
script:
25+
- generate-redirector-config
26+
- generate-base-files-info-json
2827

29-
name: rerun
30-
runs-on: ubuntu-latest
28+
name: "R"
29+
runs-on: ubuntu-24.04
3130
steps:
3231

3332
- name: "Restart ${{ matrix.script }}.yml"
@@ -38,10 +37,10 @@ jobs:
3837
ATTEMPTS="3"
3938
SCRIPT="${{ matrix.script }}"
4039
41-
WORKFLOW=$(gh api "/repos/${OWNER_REPO}/actions/workflows" | jq '.workflows[] | select(.path==".github/workflows/'${{ matrix.script }}'.yml")' | jq -r '.id')
42-
read ID STATUS ATTEMPT <<< $(gh api "/repos/${OWNER_REPO}/actions/workflows/${WORKFLOW}/runs" | jq '.workflow_runs[]' | jq -r '.id,.conclusion,.run_attempt' | head -3 | xargs -n3 -d'\n')
40+
WORKFLOW=$(gh api "/repos/${{ github.repository }}/actions/workflows" | jq '.workflows[] | select(.path==".github/workflows/'${{ matrix.script }}'.yml")' | jq -r '.id')
41+
read ID STATUS ATTEMPT <<< $(gh api "/repos/${{ github.repository }}/actions/workflows/${WORKFLOW}/runs" | jq '.workflow_runs[]' | jq -r '.id,.conclusion,.run_attempt' | head -3 | xargs -n3 -d'\n')
4342
4443
# if attempt is lower then 5 and status is "cancelled" or "failed", rerun failed jobs
4544
if [ "${ATTEMPT}" -lt "${ATTEMPTS}" ] && ([ "$STATUS" == "failure" ] || [ "$STATUS" == "failure" ]); then
46-
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${OWNER_REPO}/actions/runs/${ID}/rerun-failed-jobs
45+
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${{ github.repository }}/actions/runs/${ID}/rerun-failed-jobs
4746
fi

0 commit comments

Comments
 (0)