Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kosuke-KIDO-datalabs opened this issue Sep 15, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@Kosuke-KIDO-datalabs
Copy link

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
Copy link
Owner

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

@Kosuke-KIDO-datalabs
Copy link
Author

Kosuke-KIDO-datalabs commented Sep 16, 2024

@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.

const { eventName, payload } = context
const { repo, owner } = context.repo
const octokit = getOctokit(options.token)
const issue_number = payload.pull_request ? payload.pull_request.number : 0

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 MishaKav added the good first issue Good for newcomers label Sep 17, 2024
@MishaKav
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants