Skip to content

Fail to create issue if package.json present (and empty) in repository calling action #194

@juanitosvq

Description

@juanitosvq

The error described in #83 seems to happen if the repository calling the action contains a package.json (in my case, the file was empty):

/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:32633
		throw jsonErr;
		^
ErrorEXError [JSONError]: Unexpected end of JSON input while parsing near '' in package.json
    at module.exports (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:32628:19)
    at parse (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:18172:29)
    at Function.module.exports.sync (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:18175:29)
    at Function.sync (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:34927:27)
    at Signale.get packageConfiguration [as packageConfiguration] (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:37232:20)
    at new Signale (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:37171:39)
    at Object.528 (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:37143:32)
    at __webpack_require__ (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:38615:43)
    at Object.7045 (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:4902:17)
    at __webpack_require__ (/home/runner/work/_actions/JasonEtco/create-an-issue/v2/dist/index.js:38615:43) {
  name: 'JSONError',
  fileName: 'package.json'
}

I haven't checked to see what would happen if package.json contains some valid JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions