Skip to content

ci: gate Pages deploy behind a preflight instead of failing when Pages is off - #2

Merged
umutseve4 merged 2 commits into
mainfrom
ci/pages-preflight-gate
Sep 6, 2026
Merged

umutseve4 merged 2 commits into
mainfrom
ci/pages-preflight-gate

Conversation

@umutseve4

Copy link
Copy Markdown
Owner

Belirti

main kirmizi. Kirmizi olan tek sey pages workflow'u (kosu #2), 5. adimda:

actions/configure-pages@v5   FAILURE   1s
actions/upload-pages-artifact@v3   SKIPPED
actions/deploy-pages@v4   SKIPPED

ci workflow'u (kosu #5) ise 9 adimin tamami SUCCESS — derleme ve pixel
dogrulamasi dahil. Yani kod saglam; kirmizi olan yalnizca yayin hedefi.

Kok neden

configure-pages@v5 1 saniyede oldu. Bu sure tek basina ayirt edici: derleme
ya da ag islemi degil, ilk API cagrisinda alinan bir ret. Bu repoda GitHub
Pages acik degil
. enablement: true girdisi, repo icin bir Pages sitesi
zaten saglanmamissa Pages'i sifirdan acamaz.

Bu, econ-lakehouse'ta daha once tesbit edilen engelin ayni sinifi.

Neden sadece "Pages'i ac" demiyoruz

Pages acilana kadar bu kontrol her kosuda kirmizi olmak zorunda. Yalnizca
kirmizi olabilen bir kontrol hicbir bilgi tasimaz: ertesi gun gercek bir
derleme hatasi gelse ayni kirmiziyi gorurdun, ayirt edemezdin. Ustelik ci
tamamen yesilken depo disaridan bozuk gorunuyor.

Degisiklik

preflight isi eklendi, deploy ona bagli:

  • preflight her kosuda node tools/build-single-file.mjs calistirir.
    Derleme bozulursa is kirmizi olur — gercek hatayi gizlemiyoruz.
  • Ardindan repos/$GITHUB_REPOSITORY/pages sorgulanir; cikis kodu tek testtir.
  • Pages kapaliysa: $GITHUB_STEP_SUMMARY icine hangi ayarin acilacagi
    (Settings -> Pages -> Source: GitHub Actions) ve API'nin ham cevabi yazilir,
    bir ::warning birakilir, deploy atlanir, workflow yesil biter.
  • Pages aciksa: deploy yolu eskisiyle ayni. Tek fark, artik gereksiz olan
    enablement: true girdisinin kaldirilmis olmasi.
  • Iki ise de timeout-minutes: 10 eklendi.

Kabul kriteri

  • Bu PR'in pages kosusu yesil biter ve ozetinde "Pages KAPALI" notu gorunur.
  • ci workflow'u yesil kalir (bu PR ona dokunmuyor).
  • Umut Settings -> Pages -> Source: GitHub Actions sectikten sonra
    Run workflow ile tetiklenen kosuda deploy gercekten calisir ve yayinlar.

Son madde benim erisemedigim tek adim: Pages anahtari repo ayarlarindan acilir.

…reported, not failed

The `pages` workflow was red on every push to main. It died at
`actions/configure-pages@v5` after 1 second because GitHub Pages is not
enabled on this repository; `enablement: true` cannot switch Pages on
without a Pages site already provisioned for the repo.

A check that can only ever be red carries no information. Worse, it hides
the fact that `ci` (build + pixel verification, 9 steps) is fully green,
so the repository looks broken when only its publishing target is missing.

This adds a `preflight` job that asks the API whether Pages is enabled and
gates `deploy` on the answer. When Pages is off the workflow ends green
with a loud step-summary telling the maintainer exactly which toggle to
flip. When Pages is on, the deploy path is byte-for-byte what it was.
Build failures still go red, because `build-single-file.mjs` now runs in
the preflight job on every run regardless of the Pages state.
The first `gh api --silent --include` call captured a status line that was
only echoed and never used in a decision, and `--silent` with `--include`
is a combination whose output shape I had not verified. The single
exit-code probe is the whole test; anything else in the step is noise
that could itself fail under `pipefail`.
Copilot AI lite review requested due to automatic review settings September 6, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@umutseve4
umutseve4 merged commit 7677664 into main Sep 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants