fix(ci): make Pages deployment actually work — injection-safe commit, correct permissions, one publisher - #612
Merged
Merged
Conversation
… correct permissions, one publisher
Three defects kept the site from ever publishing:
1. deploy-docs.yml interpolated the head commit message straight into a shell
single-quoted string:
git commit -m 'Deploy: ${{ github.event.head_commit.message }}'
Any message containing parentheses, quotes or newlines broke the script
("syntax error near unexpected token `)`", exit 2) — and the same hole is a
command-injection vector, since a commit message is attacker-controllable in
a fork/PR flow. Now passed via an environment variable, with a deterministic
subject line ("Deploy <sha>") and the original message quoted in the body.
Also adds `set -euo pipefail` and exits cleanly when there is nothing new.
2. deploy-pages.yml used actions/deploy-pages@v4 without `pages: write` and
`id-token: write`, so it failed every run with "Unable to get
ACTIONS_ID_TOKEN_REQUEST_URL env variable". Permissions and the github-pages
environment added.
3. Both workflows fired on push and raced for the same Pages target.
deploy-docs.yml is the real publisher (it builds apps/website AND docs and
pushes the combined output), so deploy-pages.yml is now manual-only. Kept
rather than deleted, with a comment explaining why.
Separately (repo setting, not in this diff): Pages source was pointing at
`main /` while the workflow deploys to the `gh-pages` branch, so published
output was never served — that is why https://t27.ai/trinity/ returned 404.
Repointed to gh-pages.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
github-actions Bot
added a commit
that referenced
this pull request
Aug 8, 2026
fix(ci): make Pages deployment actually work — injection-safe commit, correct permissions, one publisher (#612) Three defects kept the site from ever publishing: 1. deploy-docs.yml interpolated the head commit message straight into a shell single-quoted string: git commit -m 'Deploy: ${{ github.event.head_commit.message }}' Any message containing parentheses, quotes or newlines broke the script ("syntax error near unexpected token `)`", exit 2) — and the same hole is a command-injection vector, since a commit message is attacker-controllable in a fork/PR flow. Now passed via an environment variable, with a deterministic subject line ("Deploy <sha>") and the original message quoted in the body. Also adds `set -euo pipefail` and exits cleanly when there is nothing new. 2. deploy-pages.yml used actions/deploy-pages@v4 without `pages: write` and `id-token: write`, so it failed every run with "Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable". Permissions and the github-pages environment added. 3. Both workflows fired on push and raced for the same Pages target. deploy-docs.yml is the real publisher (it builds apps/website AND docs and pushes the combined output), so deploy-pages.yml is now manual-only. Kept rather than deleted, with a comment explaining why. Separately (repo setting, not in this diff): Pages source was pointing at `main /` while the workflow deploys to the `gh-pages` branch, so published output was never served — that is why https://t27.ai/trinity/ returned 404. Repointed to gh-pages. Co-authored-by: Dmitrii Vasilev <admin@t27.dev> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 8, 2026
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.
Follow-up to #611. That PR fixed the MDX error that aborted the docs build; with the build passing, three further defects surfaced — the site still never reached the web.
1. Shell injection / breakage in the deploy step 🔴
The commit message is pasted verbatim into a single-quoted shell string. A message containing
), a quote or a newline breaks the script:That is exactly what happened on the last run. The same hole is a command-injection vector — commit messages are attacker-controllable in fork/PR flows.
Fix: pass it through an
env:variable, use a deterministic subject (Deploy <sha>) with the original message quoted in the body, addset -euo pipefail, and exit 0 cleanly when there is nothing to publish.2.
deploy-pages.ymlmissing OIDC permissionsactions/deploy-pages@v4authenticates via OIDC and failed every run:Fix: added
pages: write+id-token: writeand thegithub-pagesenvironment.3. Two workflows racing for one Pages target
Both
deploy-docs.ymlanddeploy-pages.ymltriggered on push tomain.deploy-docs.ymlis the real publisher — it builds apps/website and docs and pushes the combined output — whiledeploy-pages.ymlonly ever uploadeddocs/build.Fix:
deploy-pages.ymlis nowworkflow_dispatchonly. Kept, not deleted, with a comment explaining the decision so it can be revived deliberately.4. Pages source pointed at the wrong branch (repo setting, outside this diff)
Pages was configured as
main /while the workflow publishes to thegh-pagesbranch — so even a successful deploy served nothing. This is whyhttps://t27.ai/trinity/returned 404. Repointed togh-pages /.Verification
gh-pagesalready received a build after fix(docs): unblock Pages deploy — MDX autolink breaks the Docusaurus build #611 landed, confirming the docs build itself is fixed.mainshould produce a greenDeploy Website + Docsrun and a live site — I will confirm the actual HTTP response rather than assume.Note
Other red checks in this repo (e.g.
zig build author-guardreporting "no build.zig file found") are pre-existing onmainand unrelated to Pages.🤖 Generated with Claude Code