mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Both were created without the executable bit, which every sibling under scripts/ carries and which tests/lint/filesystem/shell/test_executable.py enforces. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
29 lines
725 B
Bash
Executable File
29 lines
725 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Emit due=true on GITHUB_OUTPUT when the current hour opens an interval window
|
|
# counted from 00:00 UTC. Intervals are rounded up to whole hours.
|
|
#
|
|
# Inputs via env:
|
|
# INTERVAL_MINUTES wanted interval between two sweeps
|
|
|
|
set -euo pipefail
|
|
|
|
: "${INTERVAL_MINUTES:?Missing INTERVAL_MINUTES}"
|
|
: "${GITHUB_OUTPUT:?Missing GITHUB_OUTPUT}"
|
|
|
|
hours="$(((INTERVAL_MINUTES + 59) / 60))"
|
|
|
|
if ((hours < 1)); then
|
|
hours=1
|
|
fi
|
|
|
|
hour="$((10#$(date -u +%H)))"
|
|
|
|
if ((hour % hours == 0)); then
|
|
echo "$(date -u +%H:%M) UTC opens the ${hours}h window, sweeping"
|
|
echo "due=true" >>"${GITHUB_OUTPUT}"
|
|
else
|
|
echo "$(date -u +%H:%M) UTC is inside the ${hours}h window, skipping"
|
|
echo "due=false" >>"${GITHUB_OUTPUT}"
|
|
fi
|