From 8a6dfe21bcc3894d362d58a466eb64dc9293f32c Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 19 Nov 2026 10:51:19 +0100 Subject: [PATCH 1/2] Continue publishing preview builds when a package fails `yarn workspaces foreach` stops starting new publishes after the first failure, so one broken package blocked every package after it. Loop over the public workspaces instead, log a warning for each failed publish, and carry on with the rest. --- .github/workflows/publish-preview-oidc.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-preview-oidc.yml b/.github/workflows/publish-preview-oidc.yml index b344b05b..b1b15b2c 100644 --- a/.github/workflows/publish-preview-oidc.yml +++ b/.github/workflows/publish-preview-oidc.yml @@ -150,7 +150,14 @@ jobs: - name: Publish preview builds (monorepo) if: ${{ inputs.is-monorepo && !inputs.dry-run }} - run: yarn workspaces foreach --no-private --all exec yarn npm publish --tag preview + run: | + while IFS=$'\t' read -r name location; do + echo "::group::Publishing $name" + if ! (cd "$location" && yarn npm publish --tag preview); then + echo "::warning::Failed to publish $name" + fi + echo "::endgroup::" + done < <(yarn workspaces list --no-private --json | jq -r '[.name, .location] | @tsv') env: YARN_NPM_REGISTRY_SERVER: 'https://registry.npmjs.org' From 8ea7c77c5b92e7597d9a630872db85c9b06635aa Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Thu, 19 Nov 2026 11:05:28 +0100 Subject: [PATCH 2/2] Report failed preview publishes in the build message The publish step now records each package as published or failed. The "Generate preview build message" step reads those lists instead of looking up every workspace again. Failed packages are listed with a link to the workflow run, and the message no longer says builds were published when none were. --- .github/workflows/publish-preview-oidc.yml | 42 +++++++++++++++------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-preview-oidc.yml b/.github/workflows/publish-preview-oidc.yml index b1b15b2c..ffac1280 100644 --- a/.github/workflows/publish-preview-oidc.yml +++ b/.github/workflows/publish-preview-oidc.yml @@ -152,9 +152,13 @@ jobs: if: ${{ inputs.is-monorepo && !inputs.dry-run }} run: | while IFS=$'\t' read -r name location; do + version="$(jq -r '.version' "$location/package.json")" echo "::group::Publishing $name" - if ! (cd "$location" && yarn npm publish --tag preview); then + if (cd "$location" && yarn npm publish --tag preview); then + echo "${name}@${version}" >> "$RUNNER_TEMP/published.txt" + else echo "::warning::Failed to publish $name" + echo "${name}@${version}" >> "$RUNNER_TEMP/failed.txt" fi echo "::endgroup::" done < <(yarn workspaces list --no-private --json | jq -r '[.name, .location] | @tsv') @@ -182,27 +186,39 @@ jobs: fi if [[ "$IS_MONOREPO" == "true" ]]; then - packages="$( - yarn workspaces list --no-private --json \ - | jq --raw-output '.location' \ - | xargs -I{} cat '{}/package.json' \ - | jq --raw-output '"\(.name)@\(.version)"' - )" - echo -n "Preview builds have been published." > preview-build-message.txt - if [[ -n "$docs_link" ]]; then - echo -n " ${docs_link}" >> preview-build-message.txt - fi - cat <<-MSGEOF >> preview-build-message.txt + published="$(cat "$RUNNER_TEMP/published.txt" 2>/dev/null || true)" + failed="$(cat "$RUNNER_TEMP/failed.txt" 2>/dev/null || true)" + + if [[ -n "$published" ]]; then + echo -n "Preview builds have been published." > preview-build-message.txt + if [[ -n "$docs_link" ]]; then + echo -n " ${docs_link}" >> preview-build-message.txt + fi + cat <<-MSGEOF >> preview-build-message.txt
Expand for full list of packages and versions. \`\`\` - ${packages} + ${published} \`\`\`
MSGEOF + else + echo "No preview builds were published." > preview-build-message.txt + fi + + if [[ -n "$failed" ]]; then + cat <<-MSGEOF >> preview-build-message.txt + + The following packages failed to publish. [See the workflow run for details](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}). + + \`\`\` + ${failed} + \`\`\` + MSGEOF + fi else name="$(jq -r '.name' package.json)" version="$(jq -r '.version' package.json)"