vsoch / pull-request-action

open a pull request when a branch is pushed or updated

Home Page:https://github.com/marketplace/actions/pull-request-action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If PR exists, update title and body

shaungrady opened this issue · comments

In my workflow, the PR title and body are dynamically generated based on the commits contained within. I would love it if this action could update the title and body of the PR the PR is already found.

hey @shaungrady ! It looks like this is definitely possible: https://docs.github.com/en/rest/reference/pulls#update-a-pull-request. I'll try to take a look soon and see if I can add this. Likely I'd keep the default to still exit if the PR is open, but we could add a variable that you could use to specify wanting an update in this case. I'll definitely try to make some time in the next week or so to work on this, stay tuned!

hey @shaungrady - here is a branch for you to test! #60 See in the description how it works - if you set PULL_REQUEST_UPDATE it will update the existing PR instead of exiting or otherwise ending. I also did some refactoring of the main function body to take advantage of sharing the functions for adding reviewers and assignees regardless of an update or creation, so we will want to check that everything still works. Thank you for testing!

Sorry I haven't gotten back to you @vsoch, I ended up solving the issue by hand with actions/github-script@v3 before you opened up your PR. Not sure when I'll have time to give it a test.

As long as you eventually do it (can you give me a sense of when?) there is definitely no rush! I did jump on doing this fix for you, so I hope that you could make some small amount of time in the future to test it - it's a fairly nice feature and I suspect others will appreciate having it, even if you found another solution.

Don't get me wrong, I do appreciate your speed and responsiveness on this issue. I'll try to make some time this weekend.

Thank you! <3