Repository navigation
ci: gate Pages deploy behind a preflight instead of failing when Pages is off - #2
Merged
Merged
Conversation
…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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Belirti
mainkirmizi. Kirmizi olan tek seypagesworkflow'u (kosu #2), 5. adimda:ciworkflow'u (kosu #5) ise 9 adimin tamami SUCCESS — derleme ve pixeldogrulamasi dahil. Yani kod saglam; kirmizi olan yalnizca yayin hedefi.
Kok neden
configure-pages@v51 saniyede oldu. Bu sure tek basina ayirt edici: derlemeya da ag islemi degil, ilk API cagrisinda alinan bir ret. Bu repoda GitHub
Pages acik degil.
enablement: truegirdisi, repo icin bir Pages sitesizaten 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
citamamen yesilken depo disaridan bozuk gorunuyor.
Degisiklik
preflightisi eklendi,deployona bagli:preflighther kosudanode tools/build-single-file.mjscalistirir.Derleme bozulursa is kirmizi olur — gercek hatayi gizlemiyoruz.
repos/$GITHUB_REPOSITORY/pagessorgulanir; cikis kodu tek testtir.$GITHUB_STEP_SUMMARYicine hangi ayarin acilacagi(Settings -> Pages -> Source:
GitHub Actions) ve API'nin ham cevabi yazilir,bir
::warningbirakilir,deployatlanir, workflow yesil biter.deployyolu eskisiyle ayni. Tek fark, artik gereksiz olanenablement: truegirdisinin kaldirilmis olmasi.timeout-minutes: 10eklendi.Kabul kriteri
pageskosusu yesil biter ve ozetinde "Pages KAPALI" notu gorunur.ciworkflow'u yesil kalir (bu PR ona dokunmuyor).GitHub Actionssectikten sonraRun workflowile tetiklenen kosudadeploygercekten calisir ve yayinlar.Son madde benim erisemedigim tek adim: Pages anahtari repo ayarlarindan acilir.