fix(cd): make the docs sync job open a PR - #190
Merged
Merged
Conversation
The guard `git diff --quiet` only reports tracked, modified files, so the 84 pages written into a directory that does not exist yet in landing_page were invisible and every release exited with "no changes to sync". Stage first, then check the index. Two more failures were hidden behind that one: `--base main` pointed at a branch landing_page does not have (its default is master), and the trailing `|| echo` swallowed the resulting error. Resolve the base from defaultBranchRef and let a failed `gh pr create` fail the job. Also give the generated section index `partition: deploy` so the sidebar resolves for the reference pages.
Contributor
I think we need to open a PR that manually removes the cloud_cli page the first time we create this, then following syncs should work without troubles |
AstraBert
approved these changes
Sep 2, 2026
forgems
approved these changes
Sep 2, 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.
The
sync-docsjob has never opened a PR againstlanding_page. The v0.26.0 run went green withwrote 84 reference pagesfollowed byno changes to sync.Three bugs, each enough on its own to drop the PR:
git diff --quiet -- <path>only sees tracked, modified files. Thecloud-cli/referencedirectory doesn't exist inlanding_pageyet, so all 84 pages were untracked and invisible. Even later, newly added command pages would stay invisible. Now it stages first and checksgit diff --cached.--base mainpointed at a branchlanding_pagedoesn't have — its default ismaster. Now resolved at runtime fromdefaultBranchRef.|| echo "PR already exists"swallowed everygh pr createfailure, including the bad base. Replaced by agh pr list --headpre-check, so real failures fail the job.Also adds
set -euo pipefail,permissions: contents: read, andpartition: deployon the generated section index so the docs sidebar resolves for the reference pages.Verified against a sparse clone of
landing_page: the old check returns exit 0 on the generated tree, the new one returns exit 1 with 84 files staged, anddefaultBranchRefresolves tomaster.Follow-up, not fixable from this repo:
documentation/cloud-cli.mdis a leaf page there, so acloud-cli/directory next to it gives Hugo two pages at the same URL and a section with no_index.md. It needs agit mvtocloud-cli/_index.mdbefore or with the first sync PR.