From 36050db713028eaeafd6f008fc65954e4639abeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Tsnobiladz=C3=A9?= <2479216+tsnobip@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:23:19 +0100 Subject: [PATCH] Run the website's Yarn outside the compiler checkout when publishing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish job checks out rescript-lang.org inside this checkout. Yarn reads every .yarnrc.yml from its working directory up to the root, so the website's Yarn 4.13.0 also read ours, which since #8890 sets approvedGitRepositories, a setting 4.13.0 doesn't know. It stopped with a usage error in "Use Node.js for website", so 13.0.0-alpha.7 was published without its API docs and website playground update. The job now moves the website checkout to $RUNNER_TEMP and links it back. Yarn starts in the directory the link points to, so it reads only the website's .yarnrc.yml, and the later steps keep their paths. Review: Does pushing the API docs still authenticate? The deploy key is the core.sshCommand in the website's .git/config, which moves with it, and names the key by its absolute path in $RUNNER_TEMP. Only the HTTPS token is included by gitdir path, and the website's remote uses SSH. Review: How was this tested? Locally, with this repository's .yarnrc.yml and the website's Yarn 4.13.0 nested as in the job: before the step, `yarn config get cacheFolder` fails with the CI error; after it, the command succeeds both from a shell `cd` through the link and from a spawn with the link as its cwd, which is how setup-node runs it. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Paul Tsnobiladzé <2479216+tsnobip@users.noreply.github.com> --- .github/workflows/publish.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fb3be6c787..570c6668e1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -161,6 +161,17 @@ jobs: path: rescript-lang.org ssh-key: ${{ secrets.RESCRIPT_LANG_ORG_DEPLOY_KEY }} + # Yarn reads every .yarnrc.yml from its working directory up to the + # root, so inside this checkout the website's Yarn would also read + # ours, which can hold settings its version doesn't know. Processes + # started through the link run in the moved directory, so Yarn no + # longer sees ours, and the paths below stay the same. + - name: Move rescript-lang.org out of this checkout + run: | + mv rescript-lang.org "$RUNNER_TEMP/rescript-lang.org" + ln -s "$RUNNER_TEMP/rescript-lang.org" rescript-lang.org + shell: bash + - name: Download API docs uses: actions/download-artifact@v8 with: