-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripts: exit error code 1 when status value is null #42396
Conversation
this commit is done to fix pipeline exit in case of failure. status value is `null` in case of failure
Excellent, thank you for opening an issue 👍🏻 The same issue will apply to the
|
Size Change: +268 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using macOS, so I can't test it, but code changes look good. @amustaque97, thank you so much for sending this patch.
I'll include an entry in the CHANGELOG file before landing this PR.
Fixes: #41712
What?
Introduced a new variable
EXIT_ERROR_CODE
to be used in case the status isnull
Why?
We use
wp-scripts build
to create the webpack build in a CI pipeline.The CI pipeline relies on the return code to determine the job status.
If the build fails with the "JavaScript heap out of memory" error, the wp-scripts build returns status 0.
This causes the next pipeline stage to run, which leads to the deployment of a corrupted build artifact.
How?
This is an environment-specific issue in Linux. In my local mac, it works fine. I have added an OR condition if
status
is null then returnEXIT_ERROR_CODE
. In the case of successstatus
value must be0
.Testing Instructions
NODE_OPTIONS="--max_old_space_size=64" yarn wp-scripts build
in Linux environment1
`
Screenshots or screencast NA