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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine create and update in a single configuration? #9
Comments
Hi @robdodson I think allowing this additional use case would be a good improvement to the action. It doesn't look like it would be a breaking change for the way the action is currently being used. I would very much welcome a PR for this change. |
Hi @robdodson. Let me know if you are too busy and I can apply this update myself. |
Oh sorry, I was trying to track down the comment today to work on this. If you are already working on the repo and feel like doing it that would be great 馃槉 |
No worries. I'm not working on the repo, just a reminder. I'll let you raise the PR for it since it was your idea. 馃槃 |
Released as |
Nice suggestion. Do you already have an example for the find-comment action? |
Not yet. Will see about open sourcing it at some point. |
For those looking for an ad hoc solution (or some inputs for how to implement something proper) |
Hello 馃憢
I was wondering if you would consider a PR which slightly changes the behavior of the Action to allow someone to create or update in a single configuration? My use case is I wanted to have a comment at the top of my PR that shows lint status. If it's the first the linter has run, it will create this comment. On subsequent runs, it will update this comment using
replace
.Currently the Action will always create a new comment if an issue number is passed. Here's the relevant snippet of code:
However, if you swap the order of the condition, then you can have it first check for a comment-id to update, and if one isn't passed it will check for an issue number to create a new comment:
That enables a workflow like this:
I realize you could also achieve this by writing two steps and using
if
to check if it should create or update the comment, but that felt a bit noisy to me. If you'd be open to this change then I could send over a PR. I also understand if you'd prefer to keep the Action as is because it matches your use case :)The text was updated successfully, but these errors were encountered: