Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/check-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions tests/workflows.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
Loading