lcov-reporter-action icon indicating copy to clipboard operation
lcov-reporter-action copied to clipboard

RequestError [HttpError]: Empty value for parameter 'issue_number': undefined

Open aropan opened this issue 3 years ago • 2 comments

I got the error on push:

...
RequestError [HttpError]: Empty value for parameter 'issue_number': undefined
    at /data/actions-runner/_work/_actions/romeovs/lcov-reporter-action/v0.3.1/dist/main.js:22256:15
    at Array.forEach (<anonymous>)
    at /data/actions-runner/_work/_actions/romeovs/lcov-reporter-action/v0.3.1/dist/main.js:22224:12
    at Array.forEach (<anonymous>)
    at validate$1 (/data/actions-runner/_work/_actions/romeovs/lcov-reporter-action/v0.3.1/dist/main.js:22197:23) {
  status: 400,
...

when using config:

...
      - name: Report
        uses: romeovs/[email protected]
        with:
          lcov-file: lcov.info
          lcov-base: base.lcov.info
          github-token: ${{ secrets.GITHUB_TOKEN }}
          filter-changed-files: true
          delete-old-comments: true
...

aropan avatar Dec 03 '21 15:12 aropan

I think this problem with check shouldDeleteOldComments. It should be inside condition (github_1.eventName === "pull_request") {:

...
	if (shouldDeleteOldComments) {
		await deleteOldComments(githubClient, options, github_1);
	}

	if (github_1.eventName === "pull_request") {
		await githubClient.issues.createComment({
			repo: github_1.repo.repo,
			owner: github_1.repo.owner,
			issue_number: github_1.payload.pull_request.number,
			body: body,
		});
	} else if (github_1.eventName === "push") {
		await githubClient.repos.createCommitComment({
			repo: github_1.repo.repo,
			owner: github_1.repo.owner,
			commit_sha: options.commit,
			body: body,
		});
	}
...

aropan avatar Dec 03 '21 15:12 aropan

@aropan thanks this was saving me too (on a fork :) ), triggering report coverage step for a workflow that is not PR produces this error

in the step we could disable report coverage by adding the if you was talking about 👍

      - name: Report coverage
        if: github.event_name == 'pull_request'

boly38 avatar Jun 13 '24 07:06 boly38