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

Update PR title when updating existing PR #309

Closed
joffrey-bion opened this issue Aug 12, 2021 · 6 comments · Fixed by #416
Closed

Update PR title when updating existing PR #309

joffrey-bion opened this issue Aug 12, 2021 · 6 comments · Fixed by #416
Labels

Comments

@joffrey-bion
Copy link

joffrey-bion commented Aug 12, 2021

When a PR already exists for the branch, the PR title given in the action is ignored and the existing title is used.
It would be great if the title was used to update the PR title if it's different.

Some background / use case: I have a workflow where I update some JSON protocol descriptors, which I use to generate code and make a PR to my repo. I still want to review these PRs and thus merge manually. Since the workflow runs every day, sometimes there are multiple protocol updates before I merge the PR, so the PR is updated multiple times.

My problem is that the new version of the protocol is in the PR title, so when there is an existing PR, I would like my dynamic title from the github action to be used to update the PR. I use PR titles in changelog, so they are important to me.

@gr2m
Copy link
Owner

gr2m commented Aug 12, 2021

I fear that would be a breaking change. I have the opposite use case quite a lot. I update the pull request to what I want the squash commit message to be, but do not merge yet. If another change occurs, then I don't want the action to overwrite my custom title.

Maybe I can add outputs to the action, so that you would know if the pull request was created or updated, and what the pull request number is. Then you could use https://github.com/octokit/request-action/ to update the pull request title to your liking?

@joffrey-bion
Copy link
Author

I'm not sure I understand your use case correctly. If the title in the GitHub action is dynamic and reflects the squashed message, then why wouldn't the updated one be more appropriate when you add one more commit?

Or do you mean you update the PR title by hand and then don't want the action to overwrite it?

In that case I guess it would be great to have a boolean option in the action, stating whether we want to overwrite the title when the PR already exists.
Another option for me would be the ability to automatically discard the previous PR and open a new one, but that's less convenient (in case the link to the PR was already shared, for instance).

@gr2m
Copy link
Owner

gr2m commented Aug 12, 2021

Or do you mean you update the PR title by hand and then don't want the action to overwrite it?

yes, that's what I mean

In that case I guess it would be great to have a boolean option in the action, stating whether we want to overwrite the title when the PR already exists.

I'm reluctant adding new options. You are the first to ask for it, so we can leave the issue open and see if others ask for it. I did not run into the situation myself.

@joffrey-bion
Copy link
Author

Fair enough. Let's wait for more opinions.

To be honest, I would have expected this to be the default behaviour (since the name of the action implies it updates PRs as well).

I wouldn't expect the behaviour to be optimized for mixing manual and automatic work, but rather optimized for full automation.

@gkuga
Copy link

gkuga commented Dec 2, 2021

In our case, we need the body of existing PR to be updated. Because we create and update pull requests with this action automatically via repository_dispatch and the pr body has updated information.

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants