Repository navigation
fix(publish): nightly run leaves a draft Release, never uploads to YouTube - #13
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s to YouTube A schedule or repository_dispatch run now publishes nothing. It renders, creates a draft GitHub Release, and writes a posting.anyrouter.dev draft folder per film to the posting-drafts artifact. The render job holds no YouTube credentials. youtube.yml is the only upload path, owner-dispatched and private. publish.mjs refuses YT_PRIVACY=public everywhere, and refuses a YouTube upload or a non-draft Release on an unattended run. Fixes duyet/anyrouter#6656 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
The nightly
render-video.ymlrun (cron17 7 * * *, plusrepository_dispatch) published with no owner step. It created a public GitHub Release with AI-planned copy and uploaded unlisted YouTube videos. After this PR an unattended run publishes nothing:--publish --draft --no-youtube --accept), and writes one posting.anyrouter.dev draft folder per film (post.md+ landscape mp4 + cover) to aposting-draftsworkflow artifact. The owner pushes that folder withnpx tsx scripts/posting-draft.ts <folder>in duyet/anyrouter and reviews it there.YOUTUBE_*secret orYT_PRIVACYin its env, so it cannot reach YouTube.regen --publish(replaces assets of a published Release) runs only onworkflow_dispatch.youtube.yml(owner dispatch only) is the single upload path and setsYT_PRIVACY: privateliterally; the repo varunlistedis no longer read.lib/publish.mjs:YT_PRIVACYaccepts onlyprivate(default) orunlisted; anything else throws before GitHub or YouTube is called.schedule/repository_dispatchit throws unless the call is--draft --no-youtube, and refuses--replace.published.draft: true;ledgershows it asdraft.Guard
lib/unattended.test.mjsreads every workflow as text (the test job has no YAML parser). It fails if:schedule,repository_dispatch,push,pull_requestorworkflow_runmentionsYOUTUBE_orYT_PRIVACY;--publishline in such a workflow lacks--draft --no-youtube(unless it is gated onGITHUB_EVENT_NAME = workflow_dispatch);youtube.ymlholdsYOUTUBE_REFRESH_TOKEN, oryoutube.ymlhas a trigger other thanworkflow_dispatchor a privacy other thanprivate.Tests
4eba838adds the tests alone: 10 fail against the old code (4 workflow guards, 6 publish cases).b91bf66makes them pass.node --test: 199 pass, 0 fail. All GitHub and YouTube calls are mocked clients; nothing was published or uploaded.Owner decisions (nothing was deleted)
YT_PRIVACY=unlistedrepo variable (no longer read by any workflow).invalid_grant); re-authorise only when you wantyoutube.ymlto work again.posting-draftsartifact is the hand-off.youtube.ymlfor that release if you want the private upload.27 unlisted YouTube videos (from the ledger)
72 public GitHub Releases
Fixes duyet/anyrouter#6656
🤖 Generated with Claude Code