pull request auto format and push it back

I want an action to auto gofmt the code and if it has some diff pust it back to pr repo. 

After searching for a while. I found this: https://github.com/ad-m/github-push-action but the push branch is hard code.

How can I get the pr branch and push it back. Thanks in advance!

@rongyi  I am not very clear what does your pr branch mean. For example, there is a pull request from dev to master , do you want to push back to dev branch?  

If I am right, you could get the branch name from github.event.pull_request.head.ref. Then the github-push-action has an input variable : branch , you could specify branch name in it. Please see my workflow yml sample: 

push to branch.png