diff --git a/.github/DEVELOPING_V3.md b/.github/DEVELOPING_V3.md index bdfcad92ffb..3f2bd28365f 100644 --- a/.github/DEVELOPING_V3.md +++ b/.github/DEVELOPING_V3.md @@ -124,6 +124,9 @@ of the breaking removal on `3.x`. ## How the daily sync works +The sync runs automation code from the triggering `master` SHA while its working checkout +stays on `3.x`. + [`util-sync-master-to-3x.yml`](./workflows/util-sync-master-to-3x.yml) runs daily and **replays the `3.x`-only commits on top of `master`** (a rebase), then force-pushes `3.x`: diff --git a/.github/WORKFLOWS.md b/.github/WORKFLOWS.md index 4e4d8e9616c..f3a3f9d8a26 100644 --- a/.github/WORKFLOWS.md +++ b/.github/WORKFLOWS.md @@ -617,6 +617,9 @@ Push to master/1.x ## v3 development (master + 3.x) +The sync runs automation code from the triggering `master` SHA while its working checkout +stays on `3.x`. + During the v3 release window, `master` carries normal feature work (behind opt-in flags) and the long-lived `3.x` branch carries breaking changes. `util-sync-master-to-3x.yml` syncs daily by **replaying the `3.x`-only commits onto `master` and force-pushing `3.x`**, so a diff --git a/.github/workflows/util-sync-master-to-3x.yml b/.github/workflows/util-sync-master-to-3x.yml index b06a16bc908..03122f23eae 100644 --- a/.github/workflows/util-sync-master-to-3x.yml +++ b/.github/workflows/util-sync-master-to-3x.yml @@ -78,11 +78,22 @@ jobs: cache-dependency-path: .github/scripts/pnpm-lock.yaml build-command: '' + - name: Stage automation from triggering master SHA + id: stage-automation + env: + AUTOMATION_SHA: ${{ github.sha }} + STAGING_ROOT: ${{ runner.temp }} + run: | + staging_dir="$(mktemp -d "${STAGING_ROOT}/sync-master-to-3x.XXXXXX")" + git archive "${AUTOMATION_SHA}" .github/scripts | tar -x -C "${staging_dir}" + ln -s "${GITHUB_WORKSPACE}/.github/scripts/node_modules" "${staging_dir}/.github/scripts/node_modules" + echo "script=${staging_dir}/.github/scripts/sync-master-to-3x.mjs" >> "${GITHUB_OUTPUT}" + - name: Sync master into 3.x id: sync env: GH_TOKEN: ${{ steps.app-token.outputs.token }} - run: node .github/scripts/sync-master-to-3x.mjs + run: node "${{ steps.stage-automation.outputs.script }}" notify-conflict: name: Notify Slack about conflict PR