mirror of
https://github.com/bitbaum/fleet.git
synced 2026-12-04 05:47:47 +01:00
A push made with GITHUB_TOKEN triggers no workflows. So when readings,
origin-proof or shared-inventory commit to main, main gets NO CI run for
that commit, and the auto-merge sweep then refuses every open PR with:
main is at <tip> but the newest CI run is for <older> — waiting for CI
until somebody dispatches ci.yml by hand. Nothing tells them to. The queue
simply stops, and each workflow looks perfectly healthy in isolation.
Hit FOUR times in two days — after the readings commit, then after the
origin proof commit — each time silently holding every open PR in the repo
while the cause looked like a different bug every time.
The sweep already re-arms after its OWN merges for precisely this reason,
and says so in a comment. The three workflows that commit to main never
got the same line.
All three now dispatch ci.yml after a successful push, with the
`actions: write` that dispatch needs.
- GITHUB_TOKEN deliberately, not FLEET_PAT. This only needs a CI run to
EXIST for the tip; the sweep's schedule picks it up. A PAT dispatch
would additionally emit workflow_run and wake the sweep immediately —
the cascade documented in loki CLAUDE.md, which is not wanted here.
- Never fatal. The commit is already pushed; failing the step after that
would report a proof as unwritten when it is written.
AND THE RATCHET, because this is well past the second time.
ci.yml now fails if any workflow containing `git push` lacks either the
re-arm or `actions: write`, and refuses to pass if it finds no pushing
workflows at all (a check that silently stops checking is the shape this
repo exists to delete). Inline, like the other one-invariant gates here.
Proven by mutation: deleting readings' re-arm turns it red and names the
file; restoring returns green.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
56 lines
2.0 KiB
YAML
56 lines
2.0 KiB
YAML
# The numbers the bet rests on, read nightly from sources that are not us.
|
|
#
|
|
# stars and forks from GitHub, npm downloads per shared package, paying
|
|
# clients and CHF/month from loki's apps.conf, originator share routed by
|
|
# Solon. All of them are near zero today and that is the point: a belief with
|
|
# a reading can be wrong in public, which is the only way it gets to be right.
|
|
# history[] gains a row when a reading changes, so a flat month is one row and
|
|
# one commit — never thirty.
|
|
name: Readings
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '41 4 * * *'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
# dispatch ci.yml on the commit this workflow pushes — see the re-arm below.
|
|
actions: write
|
|
|
|
concurrency:
|
|
group: readings
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
read:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Take the readings
|
|
env:
|
|
GH_TOKEN: ${{ secrets.FLEET_PAT || secrets.GITHUB_TOKEN }}
|
|
run: node scripts/ci/readings.mjs --emit registers/readings.json | tee -a "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Commit when a reading changed
|
|
run: |
|
|
set -euo pipefail
|
|
git add registers/readings.json
|
|
if git diff --cached --quiet; then
|
|
echo "no reading changed"
|
|
exit 0
|
|
fi
|
|
git config user.name "fleet-bot"
|
|
git config user.email "noreply@bitbaum.invalid"
|
|
git commit -m "chore(registers): readings $(date -u +%F)"
|
|
git push
|
|
# Re-arm CI on the commit just pushed: a GITHUB_TOKEN push triggers
|
|
# nothing, so main gets no CI run and the auto-merge sweep blocks on
|
|
# "waiting for CI to catch up" until someone dispatches it by hand.
|
|
# Full reasoning in origin-proof.yml, which had the same hole.
|
|
# Never fatal — the commit is already pushed.
|
|
GH_TOKEN="${{ secrets.GITHUB_TOKEN }}" gh workflow run ci.yml --ref main \
|
|
|| echo "could not re-arm ci.yml — the sweep will block until it is dispatched" >&2
|