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

"on: workflow_run" support: providing issue number manually #26

Closed
Akuli opened this issue May 18, 2021 · 2 comments · Fixed by #28
Closed

"on: workflow_run" support: providing issue number manually #26

Akuli opened this issue May 18, 2021 · 2 comments · Fixed by #28

Comments

@Akuli
Copy link
Contributor

Akuli commented May 18, 2021

I wanted to use this action with on: workflow_run, like this: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

But then it couldn't access the issue number (actually, pull request number), which must be provided as an explicit input to each actions when using on: workflow_run.

I started working on a PR that adds an issue_number input, so that you could do something like this, assuming the issue number is stored in issue_number.txt:

- name: Read PR number
  id: issue-number
  run: echo "::set-output name=issueNumber::$(cat issue_number.txt)"
- uses: kanga333/comment-hider@...  # version tag or full commit hash
  name: Hide old comments
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    issue_number: ${{ steps.issue-number.outputs.issueNumber }}

The problem is that it takes two steps to first make the issue number available in ${{ ... }} syntax, and then to call the comment hider. Alternatively, the comment hider could read the issue number from a file:

- uses: kanga333/comment-hider@...  # version tag or full commit hash
  name: Hide old comments
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    issue_number_file: issue_number.txt

Which way is better?

@Akuli
Copy link
Contributor Author

Akuli commented May 18, 2021

For anyone searching it, the error message for not finding issue number is Error: Not Found with no other details. That could be improved too.

@Akuli Akuli changed the title "on: workflow_run" support "on: workflow_run" support: providing issue number manually May 18, 2021
@kanga333
Copy link
Owner

Thank you for your report.
I prefer the issue_number option because I think it is better to accept simple values for input.

the error message for not finding issue number is Error: Not Found with no other details.

Sorry for the unkind message. If you will improve this message, I'm so happy. But even if you don't improve it, I would like to improve the message.

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

Successfully merging a pull request may close this issue.

2 participants