fix(deck): check the export in the pull request instead of pushing to main - #38
Merged
Merged
Conversation
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.
The defect
The Docs Deck workflow rebuilt the deck export on
mainand pushed the result. It cannot. The default branch ruleset requires every change to arrive through a pull request, and the Actions token has no bypass for that rule:A user-owned repository cannot grant the bypass either: the list offers repository roles, deploy keys, and installed GitHub Apps, and the Actions token is none of those.
The failure was near-silent. The one earlier run looked successful only because the export happened to be current, so the job hit its
git diff --quietguard and never reached the push. The first run that had real work to publish, on the merge of the iteration-session retuning, failed at that step and leftdocs/deck/checkpoint-distill.htmlstale onmain, still rendering the removed disposition labels.The fix
The workflow now checks freshness instead of producing it. On a pull request touching
deck/,docs/deck/, or the workflow itself, it rebuilds the export and fails when the committed file does not match. The author commits the rebuilt export alongside the deck change, so it travels in the same pull request as its source and cannot go stale onmainwithout a red check. The token drops tocontents: read, and no credential that can write tomainis stored anywhere.The failure message carries the fix, because the reader of a red check is the party who has to repair it.
Also in this pull request
docs/deck/checkpoint-distill.htmlrebuilt from current source. It carries the retuned ledger fragment and no longer showsdisposition:labels.deck/README.mdupdated: publishing is a manual commit, and the record of why the push cannot be automated travels with it.Verification
npm run build:single && npm run export:html && npm run check:exportrun locally. The check reports "export opens from disk, 8 pages, all with content".grep -c disposition docs/deck/checkpoint-distill.htmlreturns 0.bats -r tests/passes 124 of 124.deck/anddocs/deck/, so the rewritten workflow runs against itself here.