fix: avoid reading comments from issue #0, if action is called w/o PR#508
fix: avoid reading comments from issue #0, if action is called w/o PR#508rdhar merged 2 commits intoOP5dev:mainfrom
Conversation
|
I have validated that using the action from this PR fixes the |
And I have now validated that it still adds comments to PRs when it should. |
|
To be more specific we have validated that the action still adds comments when changes are planned (when ran with |
rdhar
left a comment
There was a problem hiding this comment.
Thank you, this is a superb fix and more than happy to expedite given earlier context.
Totally a regression error on my part, and reinforces the need for more thorough CI tests.
Previously the action would attempt to call
gh api /repos/${{ github.repository }}/issues/${{ steps.identifier.outputs.pr }}/comments, even ifsteps.identifier.outputs.prwas0. This would result in an HTTP 404 error if no relevant PR was detected by the action.This PR fixes it by adding an early abort if no relevant PR is found. The old logic was:
0)create_comment="true"if relevant, and if PR !=0.The fix is to simply skip all the steps if PR ==
0by inserting an early abort. I also removed the "if PR !=0" checks from the later steps, because those became redundant.This was a regression from #503. This PR fixes #507