Skip to content

fix(infra): resolve module crash blocking external PR enforcement#36059

Merged
Mason Daugherty (mdrxy) merged 3 commits intomasterfrom
mdrxy/fix-ci
Mar 18, 2026
Merged

fix(infra): resolve module crash blocking external PR enforcement#36059
Mason Daugherty (mdrxy) merged 3 commits intomasterfrom
mdrxy/fix-ci

Conversation

@mdrxy
Copy link
Copy Markdown
Member

pr-labeler.js used require('@actions/core') to access GitHub Actions logging/failure helpers, but that module is bundled inside actions/github-script's dist — it's not resolvable via Node's require() from a checked-out file on disk. Two of the three call sites were in rarely-hit error branches, so the bug was latent. The third (applyTierLabel) ran unconditionally, crashing the tier-label step on every external PR. Because the tier step runs before the "add external label" step, the crash prevented the external label from ever being applied — which meant require_issue_link.yml never triggered and unapproved external PRs stayed open.

Changes

  • Thread the core object (provided by actions/github-script at eval time) through loadAndInit()init() instead of calling require('@actions/core') from the checked-out script — fixes the MODULE_NOT_FOUND crash on all three call sites (ensureLabel, getContributorInfo, applyTierLabel)
  • Add a console-based fallback in loadAndInit so callers that don't need core.setFailed still work without passing it
  • Update all 9 loadAndInit(github, owner, repo) call sites across pr_labeler.yml, pr_labeler_backfill.yml, and tag-external-issues.yml to pass core

@github-actions github-actions Bot added fix For PRs that implement a fix github_actions Pull requests that update GitHub Actions code infra PRs made that include chores, devops, repo meta changes internal size: XS < 50 LOC labels Mar 18, 2026
@mdrxy Mason Daugherty (mdrxy) merged commit cf1f510 into master Mar 18, 2026
91 checks passed
@mdrxy Mason Daugherty (mdrxy) deleted the mdrxy/fix-ci branch March 18, 2026 04:53
Mason Daugherty (mdrxy) added a commit to langchain-ai/deepagents that referenced this pull request Mar 18, 2026
)

`pr-labeler.js` used `require('@actions/core')` to access GitHub Actions
logging helpers, but that module is bundled inside
`actions/github-script`'s dist — not resolvable via Node's `require()`
from a checked-out file on disk. The `applyTierLabel` call site hit this
unconditionally, crashing the tier-label step on every external PR.
Because that step runs before the "add external label" step, the crash
prevented the `external` label from ever being applied — which meant
`require_issue_link.yml` never triggered and unapproved external PRs
stayed open.

Ported from langchain-ai/langchain#36059.

## Changes
- Thread the `core` object (provided by `actions/github-script` at eval
time) through `loadAndInit()` → `init()` instead of calling
`require('@actions/core')` from the checked-out script — fixes the
`MODULE_NOT_FOUND` crash on all three call sites (`ensureLabel`,
`getContributorInfo`, `applyTierLabel`)
- Add a fail-fast guard in `init()` for missing `core` to surface a
clear error instead of an opaque `TypeError`
- Update all 10 `loadAndInit(github, owner, repo)` call sites across
`pr_labeler.yml`, `pr_labeler_backfill.yml`, and
`tag-external-issues.yml` to pass `core`
james8814 pushed a commit to james8814/deepagents that referenced this pull request Mar 20, 2026
…ngchain-ai#2007)

`pr-labeler.js` used `require('@actions/core')` to access GitHub Actions
logging helpers, but that module is bundled inside
`actions/github-script`'s dist — not resolvable via Node's `require()`
from a checked-out file on disk. The `applyTierLabel` call site hit this
unconditionally, crashing the tier-label step on every external PR.
Because that step runs before the "add external label" step, the crash
prevented the `external` label from ever being applied — which meant
`require_issue_link.yml` never triggered and unapproved external PRs
stayed open.

Ported from langchain-ai/langchain#36059.

## Changes
- Thread the `core` object (provided by `actions/github-script` at eval
time) through `loadAndInit()` → `init()` instead of calling
`require('@actions/core')` from the checked-out script — fixes the
`MODULE_NOT_FOUND` crash on all three call sites (`ensureLabel`,
`getContributorInfo`, `applyTierLabel`)
- Add a fail-fast guard in `init()` for missing `core` to surface a
clear error instead of an opaque `TypeError`
- Update all 10 `loadAndInit(github, owner, repo)` call sites across
`pr_labeler.yml`, `pr_labeler_backfill.yml`, and
`tag-external-issues.yml` to pass `core`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix For PRs that implement a fix github_actions Pull requests that update GitHub Actions code infra PRs made that include chores, devops, repo meta changes internal size: XS < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant