From a007593f0be12c8fb5d6fa3e99de1b5b11136e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20R=2E=20Galv=C3=A3o?= Date: Mon, 26 Jan 2026 11:34:53 +0100 Subject: [PATCH] chore(workflows/release): add Yarn 4 guard for publish step Use -A with yarn workspaces foreach when Yarn 4.* is detected. Yarn 4 requires a scope flag (all/recursive/since/worktree) or the command fails. --- .github/workflows/release_workspace.yml | 7 ++++++- .github/workflows/release_workspace_version.yml | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_workspace.yml b/.github/workflows/release_workspace.yml index c5a5560686..9f7f588bba 100644 --- a/.github/workflows/release_workspace.yml +++ b/.github/workflows/release_workspace.yml @@ -152,7 +152,12 @@ jobs: - name: publish run: | yarn config set -H 'npmAuthToken' "${{ secrets.RHDH_NPM_TOKEN }}" - yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish + YARN_VERSION="$(yarn --version)" + if [[ "$YARN_VERSION" == 4.* ]]; then + yarn workspaces foreach -A -v --no-private npm publish --access public --tolerate-republish + else + yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish + fi env: NODE_AUTH_TOKEN: ${{ secrets.RHDH_NPM_TOKEN }} diff --git a/.github/workflows/release_workspace_version.yml b/.github/workflows/release_workspace_version.yml index db539605d0..e970c6c4b1 100644 --- a/.github/workflows/release_workspace_version.yml +++ b/.github/workflows/release_workspace_version.yml @@ -182,7 +182,12 @@ jobs: - name: publish run: | yarn config set -H 'npmAuthToken' "$NODE_AUTH_TOKEN" - yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish --tag "maintenance" + YARN_VERSION="$(yarn --version)" + if [[ "$YARN_VERSION" == 4.* ]]; then + yarn workspaces foreach -A -v --no-private npm publish --access public --tolerate-republish --tag "maintenance" + else + yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish --tag "maintenance" + fi env: NODE_AUTH_TOKEN: ${{ secrets.RHDH_NPM_TOKEN }}