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

repo: able fill pull request title by template from md file #5901

Merged

Conversation

ivanbogomoloff
Copy link
Contributor

Hello.
I migrate from bitbacket to gogs, and in PR i want to be able auto fill PR title field.
So i write some simple code for this feature and my explanation how it works.

It works like .gogs/PULL_REQUEST.md
But fills pull request title field.
And have some feature, like branch placeholders

For example init repository:

  1. Init repo with PULL_REQUEST_TITLE.md
$ ... git init etc...
$ echo 'Merge {{headBranch}} into {{baseBranch}}' > .gogs/PULL_REQUEST_TITLE.md
$ git add . && git commit -m "custom pr title for gogs" && git push origin master
  1. Then create new branch for test compare web form
$ git checkout -b test-1
$ echo 'changes in readme' > README.md
$ git add && git commit -m "changes in readme" && git push origin test-1
  1. Go to link http://localhost:3000/ivanb/test1/compare/master...ivanb:test-1
    And we will get some html code
...
<div class="ui segment content">
<div class="field">
   <input name="title" placeholder="Заголовок" value="Merge test-1 into master" tabindex="3" autofocus="" required="">
</div>
...

Thanks for attention

internal/route/repo/pull.go Show resolved Hide resolved
internal/route/repo/pull.go Show resolved Hide resolved
@unknwon unknwon added status: needs feedback Tell me more about it status: reviewed It has been reviewed by maintainers labels Jan 22, 2020
@unknwon unknwon removed the status: needs feedback Tell me more about it label Jan 29, 2020
@unknwon unknwon changed the title Feature / able fill pull request title by template from md file repo: able fill pull request title by template from md file Jan 29, 2020
@unknwon unknwon merged commit a0342d9 into gogs:master Jan 29, 2020
@ivanbogomoloff ivanbogomoloff deleted the feature/able-fill-pull-request-title branch January 30, 2020 07:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: reviewed It has been reviewed by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants