mheap/automatic-approve-action

Run fails, "cannot find module `jest-cli`"

foosel opened this issue · 2 comments

While trying to run the action as explained in the README I get an instant failure:

Run mheap/automatic-approve-action@v1
  with:
    token: ***
    workflows: pr-labeler.yml,validate-pull-requests.yml,publish-to-github-pages.yml
    dangerous_files: .github/scripts
internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module 'jest-cli'
Require stack:
- /home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.635 (/home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js:6015:33)
    at __nccwpck_require__ (/home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js:6146:43)
    at Object.546 (/home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js:9:17)
    at __nccwpck_require__ (/home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js:6146:43)
    at /home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js:6164:37
    at Object.<anonymous> (/home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js:6167:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/mheap/automatic-approve-action/v1/dist/index.js'
  ]
}

Workflow file is this (trigger method schedule doesn't work either): https://github.com/OctoPrint/plugins.octoprint.org/blob/gh-pages/.github/workflows/auto-pr-approval.yml

Example run: https://github.com/OctoPrint/plugins.octoprint.org/runs/2547433520

Did I miss something obvious or is there an issue with the dist build? 😅

mheap commented

There was an issue with the build. Somehow I'd auto-imported jest-cli into index.js

The tests passed fine as jest-cli is required for the tests

This was resolved in e6d135e and released as 1.0.3, which should be auto-imported by any workflows using @v1

Yep, can confirm, new run just went through green. Thank you! ❤