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



Copy link

ivanbogomoloff commented Jan 12, 2020

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/
But fills pull request title field.
And have some feature, like branch placeholders

For example init repository:

  1. Init repo with
$ ... git init etc...
$ echo 'Merge {{headBranch}} into {{baseBranch}}' > .gogs/
$ 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' >
$ 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="">

Thanks for attention

internal/route/repo/pull.go Show resolved Hide resolved
internal/route/repo/pull.go Show resolved Hide resolved
Ivan Bogomolov and others added 3 commits 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
3 checks passed
3 checks passed
GolangCI No issues found!
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
@ivanbogomoloff ivanbogomoloff deleted the ivanbogomoloff:feature/able-fill-pull-request-title branch Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.