Skip to content

[CI] npm-publish.yml: "Show packed node_modules" gated on a non-existent step id #1210

@msluszniak

Description

@msluszniak

Problem description

In .github/workflows/npm-publish.yml, the guard that checks whether node_modules leaked into the published tarball uses:

- name: Check if any node_modules were packed
  id: check_node_modules
  run: ! grep --silent -E "node_modules/.+" build.log

…but the diagnostic step is gated on a step id that does not exist:

- name: Show packed node_modules
  if: failure() && steps.node_modules.outcome == 'failure'   # <-- should be steps.check_node_modules
  run: ! grep -E "node_modules/.+" build.log

There is no step with id: node_modules, so steps.node_modules.outcome is always undefined and the condition can never be true. The diagnostic never runs. If a regression ever bundles node_modules into the npm package, the publish job fails (correctly, via check_node_modules) but the log that's supposed to show which paths leaked is silently skipped.

(The diagnostic's own run is otherwise fine: ! grep -E ... prints the matching lines, then inverts the exit code — so it would surface the offending paths if it were reached.)

Proposed solution

Fix the step id reference:

- name: Show packed node_modules
  if: failure() && steps.check_node_modules.outcome == 'failure'
  run: grep -E "node_modules/.+" build.log

Alternative solutions

Drop the diagnostic step entirely and rely on Show build log, which already prints the full build.log on build failure — though it's gated on steps.build.outcome, not the node_modules check, so it wouldn't fire for this specific failure mode either. Fixing the id is the smaller, correct change.

Benefits to React Native ExecuTorch

Restores a working safety diagnostic in the daily publish pipeline, so an accidental node_modules inclusion is debuggable straight from CI logs instead of requiring a local repro.

Additional context

File: .github/workflows/npm-publish.yml (the three consecutive Check… / Show build log / Show packed node_modules steps in the build job).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Coredev expThis issue tackles problems with developer experience e.g. debbuging

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions