diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index f881c99d9dc..55c69f13e2b 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -93,6 +93,15 @@ jobs: # On non-trunk branches, --no-push avoids pushing the version # bump commit back to the branch. The published packages still # get the version bump in their package.json on npm. + # + # NX_TUI=false disables Nx's terminal UI mode, which otherwise + # buffers all task output until the run ends. lerna runs the + # build via the prepublishOnly lifecycle script; without this, + # if the build crashes mid-run (e.g. an OOM kill), the entire + # buffer is lost and the only signal in the log is + # "lifecycle 'prepublishOnly' errored" with no diagnostics. + env: + NX_TUI: 'false' run: > lerna publish ${{ inputs.version_bump || 'patch' }} --yes --no-private --loglevel=verbose diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 31c49a3c32b..3cb85d8320b 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -14,19 +14,35 @@ on: jobs: release: - # Only run this workflow on the playground repo, from the trunk branch, and when triggered by a Playground maintainer + # Only run this workflow on the playground repo. For workflow_run triggers, + # require the parent workflow to have succeeded on trunk so we don't update + # the changelog (and cascade-trigger the GitHub Release workflow) when an + # npm publish actually failed or ran on a non-trunk branch. Note: for + # workflow_run events, github.ref is always the default branch where this + # file lives, so we must use workflow_run.head_branch to gate on the + # parent's actual branch. For workflow_dispatch, restrict to Playground + # maintainers running on trunk. if: > - github.repository == 'WordPress/wordpress-playground' && - github.ref == 'refs/heads/trunk' && ( - github.event.workflow_run.conclusion == 'success' || - github.actor == 'adamziel' || - github.actor == 'dmsnell' || - github.actor == 'bgrgicak' || - github.actor == 'brandonpayton' || - github.actor == 'zaerl' || - github.actor == 'janjakes' || - github.actor == 'mho22' || - github.actor == 'ashfame' + github.repository == 'WordPress/wordpress-playground' && ( + ( + github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_branch == 'trunk' + ) || + ( + github.event_name == 'workflow_dispatch' && + github.ref == 'refs/heads/trunk' && + ( + github.actor == 'adamziel' || + github.actor == 'dmsnell' || + github.actor == 'bgrgicak' || + github.actor == 'brandonpayton' || + github.actor == 'zaerl' || + github.actor == 'janjakes' || + github.actor == 'mho22' || + github.actor == 'ashfame' + ) + ) ) # Specify runner + deployment step