MishaKav / jest-coverage-comment

Comments a pull request or commit with the jest code coverage badge, full report and tests summary
MIT License
80 stars 34 forks source link

Add the issue_number of the issue being commented on as input #97

Open Kosuke-KIDO-datalabs opened 1 month ago

Kosuke-KIDO-datalabs commented 1 month ago

It would be helpful to be able to specify the issue to comment on, as I would like to use this action in a workflow triggered by issue_comment.

MishaKav commented 1 month ago

Can you please provide an example of what you mean. Not sure that I understood you.

Kosuke-KIDO-datalabs commented 1 month ago

@MishaKav Thanks for confirming.

If triggered by issue_comment, the context pull_request should be empty. So no coverage report will be posted anywhere at that time.

So I would like to be able to set the issue_number of the post destination myself as an optional argument.

https://github.com/MishaKav/jest-coverage-comment/blob/434e6d2d37116d23d812809b61d499639842fa3b/src/create-comment.ts#L12-L16

My use case would be as follows. Instead of running every time a change is committed to PR, we want to run CI only when /test is commented. The above problem occurs because the issue_comment trigger is used in that case. https://github.com/orgs/community/discussions/25389

MishaKav commented 1 month ago

I got you, I will implement this soon when I have some free time.