From 3f5905609c3d851f440cb9e8c5f33bb2a55f5f31 Mon Sep 17 00:00:00 2001 From: Kristopher Turner Date: Sun, 12 Apr 2026 23:07:35 +0000 Subject: [PATCH] feat(standards): add scheduled sync workflow from AzureLocal/platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .github/workflows/sync-standards.yml | 94 ++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/sync-standards.yml diff --git a/.github/workflows/sync-standards.yml b/.github/workflows/sync-standards.yml new file mode 100644 index 000000000..7c2333ebe --- /dev/null +++ b/.github/workflows/sync-standards.yml @@ -0,0 +1,94 @@ +name: Sync standards from platform + +# Per ADR-0002 in AzureLocal/platform: standards/*.mdx are authored in +# AzureLocal/platform/standards/ and this site renders them. This workflow +# pulls the canonical copies and opens a PR when they diverge. + +on: + schedule: + # Weekly — Mondays 06:00 UTC. Platform releases are the authoritative + # trigger; this cron is the safety net in case a release didn't fire + # a repository_dispatch. + - cron: "0 6 * * 1" + workflow_dispatch: + inputs: + platform_ref: + description: "Platform ref to sync from (branch or tag)" + required: false + default: "main" + repository_dispatch: + # Fired by AzureLocal/platform's release workflow on every version tag. + types: + - platform-standards-updated + +permissions: + contents: write + pull-requests: write + +jobs: + sync: + name: Pull platform/standards into site + runs-on: ubuntu-latest + steps: + - name: Checkout site + uses: actions/checkout@v4 + + - name: Checkout platform + uses: actions/checkout@v4 + with: + repository: AzureLocal/platform + ref: ${{ github.event.inputs.platform_ref || github.event.client_payload.ref || 'main' }} + path: _platform + + - name: Copy platform/standards/*.mdx → site/standards/ + run: | + set -euo pipefail + mkdir -p standards + # Copy only .mdx (README.md on platform is an index for humans, not a rendered page) + find _platform/standards -maxdepth 1 -name "*.mdx" -print0 \ + | xargs -0 -I{} cp -v "{}" standards/ + rm -rf _platform + + - name: Detect changes + id: diff + run: | + 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/ + fi + + - name: Open sync PR + if: steps.diff.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: chore/sync-standards-from-platform + base: main + title: "chore(standards): sync from AzureLocal/platform" + commit-message: | + chore(standards): sync from AzureLocal/platform + + Auto-generated by .github/workflows/sync-standards.yml. + Source: AzureLocal/platform/standards/ @ ${{ github.event.inputs.platform_ref || github.event.client_payload.ref || 'main' }} + body: | + Automated pull of `standards/*.mdx` from + [`AzureLocal/platform`](https://github.com/AzureLocal/platform/tree/main/standards). + + Per [ADR-0002](https://github.com/AzureLocal/platform/blob/main/decisions/0002-standards-single-source.md), + standards are authored in the platform repo; this site is the + rendering consumer. This PR is mechanical — review for + breaking rendering changes, not for content edits. + + Trigger: `${{ github.event_name }}` + Platform ref: `${{ github.event.inputs.platform_ref || github.event.client_payload.ref || 'main' }}` + + **Do not edit `standards/*.mdx` directly on this branch** — the + next sync run will overwrite. Author edits as PRs against + `AzureLocal/platform`. + labels: | + standards + sync + delete-branch: true