From 01031fa8b5ef69fbe93c7ed13340e85dfe0f9737 Mon Sep 17 00:00:00 2001 From: noctuum <25441068+noctuum@users.noreply.github.com> Date: Wed, 21 Oct 2026 05:16:18 +0500 Subject: [PATCH] fix(workflow): schedule the check off the hour --- .github/workflows/check-updates.yml | 4 +++- docs/WORKFLOW.md | 2 +- tests/workflows.bats | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-updates.yml b/.github/workflows/check-updates.yml index 7169937..697bfa4 100644 --- a/.github/workflows/check-updates.yml +++ b/.github/workflows/check-updates.yml @@ -2,7 +2,9 @@ name: Check AUR Package Updates on: schedule: - - cron: "0 * * * *" # every hour + # Every hour at minute 17. GitHub delays scheduled runs at the start of + # every hour and drops some of them. + - cron: "17 * * * *" workflow_dispatch: permissions: diff --git a/docs/WORKFLOW.md b/docs/WORKFLOW.md index 58cf35f..bb1346d 100644 --- a/docs/WORKFLOW.md +++ b/docs/WORKFLOW.md @@ -650,7 +650,7 @@ A PKGBUILD is a bash script, and every step that reads it executes it: the audit ### 5.1 Trigger -The workflow runs every hour (`cron: "0 * * * *"`) and by hand through `workflow_dispatch`. The `check-updates` concurrency group serializes runs: a new run waits for the running one. +The workflow runs every hour at minute 17 (`cron: "17 * * * *"`) and by hand through `workflow_dispatch`. GitHub delays scheduled runs at the start of every hour and drops some of them when the load is high, so the schedule avoids minute 0. The `check-updates` concurrency group serializes runs: a new run waits for the running one. ### 5.2 Permissions and container diff --git a/tests/workflows.bats b/tests/workflows.bats index fdd747f..4f85bf4 100644 --- a/tests/workflows.bats +++ b/tests/workflows.bats @@ -164,6 +164,13 @@ step_run() { yq ".jobs.$1.steps[] | select(.name == \"$2\") | .run" "$CHECK_UPDATES" } +# GitHub delays scheduled runs at the start of every hour and drops some +@test "check-updates: runs every hour, off the start of the hour" { + run yq '.on.schedule[].cron' "$CHECK_UPDATES" + [ "$status" -eq 0 ] + [[ "$output" =~ ^([1-9]|[1-5][0-9])\ \*\ \*\ \*\ \*$ ]] +} + @test "check-updates: the check job decides the run and executes no PKGBUILD" { run yq '.jobs.check.steps[] | select(has("run")) | .run' "$CHECK_UPDATES" [ "$status" -eq 0 ]