Skip to content

fix(pr-checks): build-env could not set NODE_OPTIONS, the one variable it was for - #7

Merged
azlekov merged 1 commit into
mainfrom
fix/build-env-node-options
Aug 18, 2026
Merged

fix(pr-checks): build-env could not set NODE_OPTIONS, the one variable it was for#7
azlekov merged 1 commit into
mainfrom
fix/build-env-node-options

Conversation

@azlekov

@azlekov azlekov commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Found on kodni.me#172, the first real consumer of pr-checks.

##[error]Can't store NODE_OPTIONS output parameter using '$GITHUB_ENV' command.

The build step wrote every build-env line to $GITHUB_ENV. GitHub refuses a few names there — NODE_OPTIONS among them, since it can inject code into node processes the runner itself spawns.

That is exactly the variable this input exists to carry. Node sizes its old-space from total system RAM, which lands near 2 GB on the self-hosted pool, and next build sits right at that edge — so whether it OOMs depends on which pages a commit generates rather than on anything being wrong.

Fix

build-env is exported into the build step's own shell. Process env is not subject to the $GITHUB_ENV denylist. Nothing else needed it — install does not read build-time config — so the two steps are simply ordered.

IFS='=' read -r k v splits on the first = only, so values containing = (URLs, base64) survive. Verified:

NODE_OPTIONS=--max-old-space-size=4096
URL=https://kodni.me
KEY=a=b=c

After merge

Move v1, then re-run kodni.me#172.

🤖 Generated with Claude Code

…e it was for

The build step wrote every build-env line to $GITHUB_ENV. GitHub refuses a few
names there — NODE_OPTIONS among them, because it can inject code into node
processes the runner itself spawns — and the step fails outright:

  Can't store NODE_OPTIONS output parameter using '$GITHUB_ENV' command.

That is precisely the variable this input exists to carry. Node sizes its
old-space from total system RAM, which lands near 2 GB on the self-hosted pool,
and `next build` sits right at that edge — so whether it OOMs depends on which
pages a given commit generates rather than on anything being wrong.

build-env is now exported into the build step's own shell instead. Process env is
not subject to the $GITHUB_ENV denylist, and nothing else needed it: install does
not read build-time config, so the two steps are simply ordered.

`IFS='=' read -r k v` splits on the FIRST `=` only, so values containing `=`
(URLs, base64) survive intact. Verified.

Found on kodni.me#172, the first real consumer of this workflow.

Why: an input that cannot carry the value it was added for is worse than no
input, because callers write it and believe it took effect.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@azlekov
azlekov merged commit 765e584 into main Aug 18, 2026
1 check passed
@azlekov
azlekov deleted the fix/build-env-node-options branch August 18, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant