Similar to what was discussed by @vanniktech in #1105 but not exactly the same, because I have no interest in a "hot key" - just a button.
Summary:
If you enable branch protection for a repository and select "Require branches to be up-to-date before merging", then you get an Update Branch button whenever the branch goes stale.

However it would be convenient to have this for all my PRs, including ones in repositories that don't enforce this branch protection.
As described by @hkdobrev in #1105:
This button would merge the default branch in the PR branch with a merge commit if there are no conflicts.
It might be a little tricky to work out who has write access to that branch when it's coming from a fork. In theory this feature/button could initially work for branches within the same repository only though.
IssueHunt Summary
This is interesting, I needed it recently to avoid conflicts (merge + commit = ok; commit + merge = conflict) but I did it via CLI instead.
This might be possible via API but we don't have API authentication yet in our code. (Edit: we do now!)
The second issue is that we'd have to make another API every time the thread updates to check if the PR is up to date and add the notice+button (avoidable if we just add the button somewhere).
I'm thinking this could be more generically implemented in the Compare page, to have an option to merge without a PR:

On top of this, to facilitate updating the current PR, we could add a link to this page somewhere, if it makes sense. "This page" would be https://github.com/sindresorhus/refined-github/compare/no-reaction-comments...master
Pushing up for discussion
Huge 👍 to @rarkins' proposal. I could have used this many times.
I'm thinking this could be more generically implemented in the Compare page, to have an option to merge without a PR:
It's not clear to me how this is related to @rarkins' proposal. It seems like a totally different feature.
It's not clear to me how this is related to rarkins' proposal
_"Update branch"_ means _"merge \
From an "refined github" point of view, I would definitely prefer to just have the button available right in the PR, otherwise it seems like several non-intuitive clicks to get to the compare branches location to do this.
to facilitate updating the current PR, we could add a link to this page somewhere
@bfred-it Ah, got it. I guess that could be useful too, but not something I have ever needed. For non-PR branches, I usually never need to do it in the GitHub UI.
to facilitate updating the current PR, we could add a link to this page somewhere
That would require two clicks and would not be as clear as a direct button in a PR.
I tried this and it doesn't seem to be feasible (for non-own repos) as the API apparently doesn't care if the user selected "Allow edits from maintainers"
https://stackoverflow.com/questions/25859077/merge-from-upstream-using-the-github-api
My test with httpie:
echo '{"base":"features/jvw-103-190-pr-branches", "head":"e37c15c"}' | http POST 'https://api.github.com/repos/jerone/refined-github/merges' Authorization:"token XXXXXX"
HTTP/1.1 403 Forbidden
{
"documentation_url": "https://developer.github.com/v3/repos/merging/#perform-a-merge",
"message": "Must have admin rights to Repository."
}
I was trying to merge sindresorhus/refined-github@master into #1641
However it works correctly when pushing to a repo I have push privileges to:
echo '{"base":"test", "head":"master"}' | http POST 'https://api.github.com/repos/sindresorhus/refined-github/merges' Authorization:"token xxxxxxxxxx"
HTTP/1.1 201 Created
I tried this and it doesn't seem to be feasible (for non-own repos) as the API apparently doesn't care if the user selected "Allow edits from maintainers"
I see... Too bad. Did you try the GraphQL API? Can you report the issue to GitHub support? Looks like an oversight to me.
However it works correctly when pushing to a repo I have push privileges to:
Even if it's just for own PRs on own repos, I think it could still be useful.
GraphQL doesn’t seem to have anything like this in the mutations.
I reported the bug to GitHub, but even then there’s no mention about merging across forks, so unless you can think of a another way to create a merge commit…
@issuehunt has funded $80.00 to this issue.
@rarkins can you post the HTML of that element and its exact position/selector in the dom? We could reuse it as is. Heck if we're lucky we might be able to just submit the same form without dealing with the API.
@bfred-it here's the HTML:
<div class="branch-action-item">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form class="branch-action-btn float-right js-immediate-updates js-tryable-again js-needs-timeline-marker-header" action="/renovatebot/renovate/pull/3553/update_branch" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓" /><input type="hidden" name="authenticity_token" value="je8sVSxszMFcyxiUCvCfUF9Kv7St0OCQp0T6/BFcajRz//mm7K/wNx8Qrkdd/bo1pqOP5ZI8oxt92cIV5hGFuA==" />
<input type="hidden" name="expected_head_oid" value="80f2ee48c58fd9595d0390b4a4faf8c6dfea0a38">
<button type="submit" data-disable-with="Updating branch…"
class="btn"
>
Update branch
</button>
</form>
<div class="branch-action-item-icon completeness-indicator completeness-indicator-problem">
<svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg>
</div>
<h3 class="h4 status-heading">This branch is out-of-date with the base branch</h3>
<span class="status-meta">
Merge the latest changes from <span class="branch-name">master</span> into this branch.
</span>
</div>
Screenshot of same:

Selector: #partial-pull-merging > div.merge-pr.js-merge-pr.js-details-container.Details.is-squashing > div > div > div > div:nth-child(3) > form > button
If you need me to capture anything else, please let me know. I'm not sure how to capture what you ask for re: DOM for example.
@sindresorhus has rewarded $72.00 to @bfred-it. See it on IssueHunt
That's awesome! They saw our button on Twitter