github-tools / github-release-notes

Node module to create a release or a changelog from a tag and uses issues or commits to creating the release notes.
https://github-tools.github.io/github-release-notes/
GNU General Public License v3.0
880 stars 325 forks source link

gren works fine locally but when I am running it via github action it throws error #295

Closed JBAhire closed 3 years ago

JBAhire commented 3 years ago

I have tried running gren locally and it's working fine. I am also able to generate release-notes without any issue. But when I am trying to run it via GitHub action, I am getting below error:

 npx: installed 20 in 2.069s
(node:2493) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /home/runner/.npm/_npx/2493/lib/node_modules/gren/src/cli.js:85:16
    at Object.<anonymous> (/home/runner/.npm/_npx/2493/lib/node_modules/gren/src/cli.js:110:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/runner/.npm/_npx/2493/lib/node_modules/gren/bin/gren:3:1)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2493) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2493) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

FYI, I am running it like this:

    - run: npx gren release --data-source=commits --override
      env:
        GREN_GITHUB_TOKEN: ${{ secrets.GREN_GITHUB_TOKEN }}

Not really sure if it's because of some issue on GitHub action runner side or it's an issue with gren.

GitHub actions Runner OS: Ubuntu-20.04 Local OS: Mac

JBAhire commented 3 years ago

moved to custom dockerised action which resolved this.