Skip to content

Sync standards from platform #1

Sync standards from platform

Sync standards from platform #1

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