feat(standards): add scheduled sync workflow from AzureLocal/platform#42
Conversation
Per ADR-0002, standards are authored in AzureLocal/platform/standards/ and this site renders them. This workflow pulls the canonical copies weekly (Mon 06:00 UTC), on manual dispatch, or on repository_dispatch fired from a platform release, and opens a sync PR if the files diverge. The PR is mechanical — reviewers check rendering, not content. Content edits land as PRs against AzureLocal/platform. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to periodically and manually sync standards/*.mdx from AzureLocal/platform into this repo and open a PR when differences are detected, aligning with ADR-0002’s “single source of truth” approach.
Changes:
- Introduces a scheduled + manual +
repository_dispatchworkflow trigger for standards syncing. - Checks out
AzureLocal/platformat a selected ref and copiesstandards/*.mdxinto this repo. - Opens a PR via
peter-evans/create-pull-requestwhen changes are detected.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Copy only .mdx (README.md on platform is an index for humans, not a rendered page) | ||
| find _platform/standards -maxdepth 1 -name "*.mdx" -print0 \ |
There was a problem hiding this comment.
The copy step only overwrites/creates files; it never removes standards/*.mdx that were deleted (or renamed) upstream in AzureLocal/platform. That means the sync can report a clean diff while stale local standards pages remain and continue to render. Consider mirroring instead (e.g., delete existing standards/*.mdx before copying, or use rsync --delete for just the .mdx files) so upstream deletions are reflected here.
| # Copy only .mdx (README.md on platform is an index for humans, not a rendered page) | |
| find _platform/standards -maxdepth 1 -name "*.mdx" -print0 \ | |
| # Mirror only top-level .mdx files (README.md on platform is an index | |
| # for humans, not a rendered page) so upstream deletions/renames are | |
| # reflected locally without touching non-.mdx files. | |
| find standards -maxdepth 1 -name "*.mdx" -type f -delete | |
| find _platform/standards -maxdepth 1 -name "*.mdx" -type f -print0 \ |
| if git diff --quiet --exit-code -- standards/; then | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| echo "No standards changes — nothing to sync." | ||
| else | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| git diff --stat -- standards/ |
There was a problem hiding this comment.
git diff --quiet -- standards/ does not detect untracked files. If AzureLocal/platform adds a new standards/*.mdx, the copy step creates an untracked file here and this step can still report changed=false, so no PR is opened. Use a detector that includes untracked files (e.g., git status --porcelain -- standards/), or stage intent-to-add (git add -N standards/) before diffing.
| if git diff --quiet --exit-code -- standards/; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| echo "No standards changes — nothing to sync." | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| git diff --stat -- standards/ | |
| if [ -z "$(git status --porcelain -- standards/)" ]; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| echo "No standards changes — nothing to sync." | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| git status --short -- standards/ |
Summary
Wires this site up as the rendering consumer for
AzureLocal/platform/standards/, per ADR-0002. Part of Phase 1 (standards consolidation) of the platform rollout.Triggers:
workflow_dispatch— manual sync with optional ref input (branch or tag)repository_dispatch: platform-standards-updated— fired by the platform release workflow on every version tag (wiring on the platform side is a follow-up; cron covers until then)Behavior: copies
platform/standards/*.mdxinto this repo'sstandards/, detects diff, opens a PR titledchore(standards): sync from AzureLocal/platformif anything changed. No-op if clean.Why not auto-commit
The sync could push directly to
main, but going through a PR preserves:deploy.ymlrequiresmainpushes to be intentional)Downstream
After merge + first successful run, this unblocks deleting local
/standards/folders from the 6 product repos (azurelocal-avd,azurelocal-sofs-fslogix,azurelocal-loadtools,azurelocal-vm-conversion-toolkit,azurelocal-copilot,azurelocal-nutanix-migration) — each replaced by aSTANDARDS.mdstub pointing at platform.Test plan
workflow_dispatchagainstplatform_ref=mainproduces a no-op (site and platform now identical byte-for-byte)workflow_dispatchagainstplatform_ref=<future-tag>opens a PR if platform tagged new content🤖 Generated with Claude Code