Skip to content

Commit 1de7c5e

Browse files
eaitbrahimclaude
andauthored
ci: run every workflow on merge to main, except the release (#272)
The repository became PUBLIC on 2026-08-15. GitHub bills no Actions minutes for standard runners on public repositories, so the cost argument that kept `code-quality` and `migrate` off `push` no longer applies. Both now also run on merge to `main`; `ci` already did. `release.yml` stays `workflow_dispatch` only, deliberately and by the operator's explicit instruction. Its own header states the rule -- "Nothing about a money-moving tool should ship on a merge" -- and it could not run on `push` anyway: its `version` input is required and a push event supplies no inputs, so the job would fail at its first validation step. `migrate.yml` gains a safety property worth naming, because it is a property of the EVENT rather than of anyone's care: `db_path` is a `workflow_dispatch` input, and a push carries no inputs, so on a merge `inputs.db_path` renders empty and the job always takes its `migration_smoke.py` branch. No merge can supply a value that makes it write to a real database. The comment says so, and says not to add a default target or read one from a repo variable, since either would remove the property. `code-quality.yml` keeps its weekly schedule rather than replacing it: a CVE published against an unchanged pin is invisible to a per-merge trigger and obvious to a scheduled one. It still does NOT run on `pull_request`, and on a public repo that is now a security choice rather than a cost one -- fork PRs receive no repository secrets, so every one would fail at the preflight for a reason the contributor could not fix. KNOWN CONSEQUENCE: SONAR_TOKEN and SNYK_TOKEN do not exist at repo or org level, so `code-quality` will fail its preflight on every merge until they are added. That job exists to say why in one line rather than let the scanners fail obscurely, but it will now say it on a schedule of every merge. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent ad1ea5d commit 1de7c5e

2 files changed

Lines changed: 29 additions & 14 deletions

File tree

‎.github/workflows/code-quality.yml‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,24 @@ name: Code Quality
1616
# │ SonarQube Cloud requires -- read that file before the first run.
1717
# └───────────────────────────────────────────────────────────────────────────────────────────────
1818
#
19-
# TRIGGERS: a DELIBERATE divergence from the reference workflow this is modelled on
20-
# (TempTrak-Ingestion-Service's `code-quality.yml`), which runs on `push`, `pull_request` and
21-
# `workflow_dispatch`. Running per-push here would reintroduce exactly the automatic Actions spend
22-
# that `ci.yml` was just changed to remove -- the two changes would cancel out. The scheduled run
23-
# is kept because dependency scanning is the one kind of check that finds something new without
24-
# the code changing: a CVE published against a version of `cryptography` that keel has been
25-
# pinning, unmodified, for months is invisible to a per-push trigger and obvious to a weekly one.
26-
# Static analysis has no such property, but it is cheap to fold into the same weekly pass.
27-
# Adding `push:` / `pull_request:` below is a one-line change if parity with the other repo is
28-
# wanted later.
19+
# TRIGGERS. This was `workflow_dispatch` + `schedule` only, to avoid the automatic Actions spend a
20+
# per-merge trigger implies. **That constraint is gone: the repository became PUBLIC on 2026-08-15,
21+
# and GitHub bills no Actions minutes for standard runners on public repositories.** The cost
22+
# argument that kept this off `push` no longer holds, so it now also runs on every merge to `main`.
23+
#
24+
# The scheduled run is KEPT rather than replaced, deliberately: dependency scanning is the one kind
25+
# of check that finds something new WITHOUT the code changing. A CVE published against a version of
26+
# `cryptography` that keel has been pinning, unmodified, for months is invisible to a per-merge
27+
# trigger and obvious to a weekly one. Static analysis has no such property, but it is cheap to
28+
# fold into the same pass.
29+
#
30+
# `pull_request` is still deliberately absent, and on a public repo that is now a SECURITY choice
31+
# rather than a cost one: `pull_request` fires for forks, fork runs receive no repository secrets,
32+
# so every fork PR would fail at the preflight below for a reason the contributor cannot fix.
2933
on:
3034
workflow_dispatch:
35+
push:
36+
branches: [main]
3137
schedule:
3238
# 06:00 UTC every Monday. A fixed weekday makes a newly-appeared finding easy to date, and
3339
# off-the-hour minutes avoid the top-of-hour scheduling queue on GitHub's shared runners.

‎.github/workflows/migrate.yml‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
name: Migrate database
22

3-
# MANUAL ONLY. Schema migration for an EXISTING database -- never runs on push or merge.
3+
# Migrating a REAL database is manual only. Merging to `main` runs the migration-chain SMOKE TEST,
4+
# and structurally cannot do more than that -- see the safety property below.
45
#
56
# Migration is deliberately separate from seeding: `keel init` seeds the strategy (rules) library
67
# on a FRESH deployment, while `keel migrate` only evolves an existing database's schema. Seeding
78
# on migrate would resurrect rules that were deliberately deleted or refuted.
89
#
10+
# ⚠️ THE SAFETY PROPERTY THAT MAKES THE `push` TRIGGER SOUND, and it is a property of the event, not
11+
# of anyone's discipline: `db_path` is a `workflow_dispatch` INPUT. A `push` event carries no
12+
# inputs, so on a merge `${{ inputs.db_path }}` renders EMPTY and the job below takes its
13+
# `migration_smoke.py` branch -- always. There is no value a merge can supply that would make it
14+
# migrate a real database. Only a human dispatching it by hand can pass a `db_path`.
15+
# Do not "helpfully" add a default target or read a path from a repo variable: either would remove
16+
# this property and let a merge write to a live database.
17+
#
918
# DEFERRED SEAM: today `keel.db` is local, git-ignored and single-user, so CI has no database to
1019
# reach. Once the app is server-hosted, that deployment's database becomes the `db_path` target
11-
# (via a self-hosted runner or a mounted volume) and the release workflow can call this job. Until
12-
# then, dispatching this with no target runs a migration-integrity check instead of pretending to
13-
# migrate something that is not there.
20+
# (via a self-hosted runner or a mounted volume) and the release workflow can call this job.
1421
on:
1522
workflow_dispatch:
1623
inputs:
@@ -19,6 +26,8 @@ on:
1926
required: false
2027
type: string
2128
default: ""
29+
push:
30+
branches: [main]
2231

2332
permissions:
2433
contents: read

0 commit comments

Comments
 (0)