Skip to content

v1 distribution missing @actions/core – action fails at runtimeΒ #2

@tmbtech

Description

@tmbtech

πŸ› Bug Report

The published tmbtech/multi-codeowners@v1 GitHub Action fails at runtime with a module resolution error, preventing code owner enforcement workflows from functioning.

πŸ’₯ Error Message

Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/tmbtech/multi-codeowners/v1/dist/index.js

πŸ” Root Cause

The published v1 tag contains a dist/index.js file that attempts to require @actions/core at runtime, but this dependency was not properly bundled into the distribution.

Technical Details

  1. Missing Bundling Step: The action's build process should bundle all npm dependencies into the dist/ directory using a tool like @vercel/ncc or webpack
  2. Runtime Dependency: In GitHub Actions environment, only the contents of the action's repository are available - npm packages are not installed automatically
  3. Distribution Mismatch: The published v1 tag contains unbundled JavaScript that expects node_modules to be present

πŸ“‹ Reproduction Steps

  1. Create any workflow using tmbtech/multi-codeowners@v1
  2. Trigger the workflow on a pull request
  3. Observe runtime module resolution failure

πŸ“Š Evidence

  • βœ… Unit tests pass - indicating the source code is functional
  • βœ… Action builds successfully - confirming TypeScript compilation works
  • ❌ Runtime failure - only occurs when action executes in GitHub Actions environment
  • ❌ Missing bundled dependencies - @actions/core and other npm packages not in distribution

πŸ› οΈ Suggested Solution

Immediate Fix

  1. Rebuild distribution: Run the proper build pipeline with bundling

    npm run build
    npm run package  # or equivalent bundling step using ncc/webpack
  2. Publish fixed version: Release as v1.0.1 or v1.1.0

    git add dist/
    git commit -m "fix: bundle dependencies in distribution"
    git tag v1.0.1
    git push origin v1.0.1

Long-term Prevention

  1. Add bundling check to CI pipeline
  2. Test distribution in isolated environment before publishing
  3. Automate releases with proper build/bundle/test workflow

πŸ”— Failing Examples

πŸ“ˆ Impact

Severity: High - Action completely non-functional
Status: πŸ”΄ Blocking all workflows using v1 tag

πŸ’‘ Workaround

We've created a temporary implementation in our test repo while waiting for the fix. Once resolved, we'll update to use the fixed upstream action.


Report Generated: 2025-08-29

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions