fix(infra): resolve module crash blocking external PR enforcement#36059
Merged
Mason Daugherty (mdrxy) merged 3 commits intomasterfrom Mar 18, 2026
Merged
fix(infra): resolve module crash blocking external PR enforcement#36059Mason Daugherty (mdrxy) merged 3 commits intomasterfrom
Mason Daugherty (mdrxy) merged 3 commits intomasterfrom
Conversation
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pr-labeler.jsusedrequire('@actions/core')to access GitHub Actions logging/failure helpers, but that module is bundled insideactions/github-script's dist — it's not resolvable via Node'srequire()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 theexternallabel from ever being applied — which meantrequire_issue_link.ymlnever triggered and unapproved external PRs stayed open.Changes
coreobject (provided byactions/github-scriptat eval time) throughloadAndInit()→init()instead of callingrequire('@actions/core')from the checked-out script — fixes theMODULE_NOT_FOUNDcrash on all three call sites (ensureLabel,getContributorInfo,applyTierLabel)loadAndInitso callers that don't needcore.setFailedstill work without passing itloadAndInit(github, owner, repo)call sites acrosspr_labeler.yml,pr_labeler_backfill.yml, andtag-external-issues.ymlto passcore