Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commitb403633

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent6f4a515 commitb403633

File tree

11 files changed

+582
-134
lines changed

11 files changed

+582
-134
lines changed

‎assets/javascripts/initial.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
// before anything happens, check if this is a versionless enterprise URL
22
path=window.location.pathname;
3+
hash=window.location.hash;
34
paths=path.split("/");
45
if(paths[1]=="enterprise"&&(paths[2].length===0||isNaN(paths[2]))){
56
paths.splice(2,0,String({{site.version}}));
67
suffix=window.location.search||window.location.hash;
78
window.location.href=window.location.protocol+"//"+window.location.host+paths.join("/")+suffix;
89
}
10+
if(path=="/v3/repos/"&&hash=="#enabling-and-disabling-branch-protection"){
11+
window.location.href="/v3/repos/branches/#get-branch-protection";
12+
}
13+
if(path=="/v3/repos/"&&hash=="#list-branches"){
14+
window.location.href="/v3/repos/branches/#list-branches";
15+
}
16+
if(path=="/v3/repos/"&&hash=="#get-branch"){
17+
window.location.href="/v3/repos/branches/#get-branch";
18+
}

‎content/changes/2014-03-18-paginating-method-changes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Here's the complete list of updated methods:
119119
[Pull Request files]:/v3/pulls/#list-pull-requests-files
120120
[Release assets]:/v3/repos/releases/#list-assets-for-a-release
121121
[Repository contributors]:/v3/repos/#list-contributors
122-
[Repository branches]:/v3/repos/#list-branches
122+
[Repository branches]:/v3/repos/branches/#list-branches
123123
[Repository tags]:/v3/repos/#list-tags
124124
[Repository teams]:/v3/repos/#list-teams
125125
[Team members]:/v3/orgs/teams/#list-team-members

‎content/changes/2015-11-11-protected-branches-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Protected Branches API Preview Period
33
author_name:nakajima
44
---
55

6+
**UPDATE (2016-06-27):** As[announced](/changes/2016-06-27-protected-branches-api-update/), there is an extended version of the protected branches API available. This older version will be removed once the new one becomes official.
7+
68
We're starting a preview period for the[protected branches](https://github.com/blog/2051-protected-branches-and-required-status-checks) API. Protecting a branch prevents force-pushes to it as well as deleting it. You can also specify required status checks that are required to merge code into the branch.
79

810
To protect a branch, make a`PATCH` request to the URL of the branch:
@@ -33,6 +35,6 @@ To access this functionality during the preview period, you’ll need to provide
3335
application/vnd.github.loki-preview+json
3436
```
3537

36-
Take a look at[the docs here](/v3/repos/#enabling-and-disabling-branch-protection).
38+
Take a look at[the docs here](/v3/repos/branches/).
3739

3840
If you have any questions, please[get in touch](https://github.com/contact?form%5Bsubject%5D=Protected+Branches+API+Preview).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title:Update to Protected Branches API Preview
3+
author_name:tma
4+
---
5+
6+
Over the past few months, we've made a few[improvements](https://github.com/blog/2137-protected-branches-improvements) to the way[protected branches](https://github.com/blog/2051-protected-branches-and-required-status-checks) work in our web interface. Today, we're modifying the protected branches API[preview period](https://developer.github.com/changes/2015-11-11-protected-branches-api/) to include these improvements.
7+
8+
Included in these API changes is the ability to allow organizations to specify which members and teams should be able to push to a protected branch, as well as providing a new setting for required status checks which will remove the requirement of a pull request to be up to date before merging.
9+
10+
You'll notice a new endpoint structure. One set of endpoints for modifying the branch settings as a whole (`PATCH /repos/:owner/:repo/branches/:branch` has been updated to be`PUT /repos/:owner/:repo/branches/:branch/protection`), and a series of more granular endpoints to modify a subset of the branch protection settings.
11+
12+
**This will be a breaking change for the protected branch API.** The deprecated API endpoint will be removed when the protected branches API will leave the preview period. If you're trying out the old protected branches API, you'll need to update your code.
13+
14+
####How can I try it?
15+
16+
To access this functionality during the preview period, you’ll need to provide the following custom media type in the Accept header:
17+
18+
```
19+
application/vnd.github.loki-preview+json
20+
```
21+
22+
Take a look at[the docs here](/v3/repos/branches/). If you have any questions, please[get in touch](https://github.com/contact?form%5Bsubject%5D=Protected+Branches+API+Preview).

‎content/v3/repos.md

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -250,122 +250,6 @@ List languages for the specified repository. The value on the right of a languag
250250
<%= headers 200,:pagination => default_pagination_rels %>
251251
<%= json(:tag) { |h|[h] } %>
252252

253-
##List Branches
254-
255-
GET /repos/:owner/:repo/branches
256-
257-
###Parameters
258-
259-
Name | Type | Description
260-
-----|------|-------------
261-
`protected`|`string` | Set to`1` or`true` to only return protected branches.
262-
263-
{{#tip}}
264-
265-
<aname="preview-period"></a>
266-
267-
The`protected` parameter is currently available for developers to preview.
268-
During the preview period, the API may change without advance notice.
269-
Please see the[blog post](/changes/2015-11-11-protected-branches-api) for full details.
270-
271-
To access the API during the preview period, you must provide a custom[media type](/v3/media) in the`Accept` header:
272-
273-
application/vnd.github.loki-preview+json
274-
275-
The`protection` key will only be present in branch payloads if this header is passed.
276-
277-
{{/tip}}
278-
279-
###Response
280-
281-
<%= headers 200,:pagination => default_pagination_rels %>
282-
<%= json(:branches) %>
283-
284-
##Get Branch
285-
286-
GET /repos/:owner/:repo/branches/:branch
287-
288-
###Response
289-
290-
{{#tip}}
291-
292-
<aname="preview-period"></a>
293-
294-
The Protected Branch API is currently available for developers to preview.
295-
During the preview period, the API may change without advance notice.
296-
Please see the[blog post](/changes/2015-11-11-protected-branches-api) for full details.
297-
298-
To access the API during the preview period, you must provide a custom[media type](/v3/media) in the`Accept` header:
299-
300-
application/vnd.github.loki-preview+json
301-
302-
The`protection` key will only be present in branch payloads if this header is passed.
303-
304-
{{/tip}}
305-
306-
<%= headers 200 %>
307-
<%= json(:branch) %>
308-
309-
{% if page.version == 'dotcom' or page.version >= 2.5 %}
310-
311-
##Enabling and disabling branch protection
312-
313-
{{#tip}}
314-
315-
<aname="preview-period"></a>
316-
317-
The Protected Branch API is currently available for developers to preview.
318-
During the preview period, the API may change without advance notice.
319-
Please see the[blog post](/changes/2015-11-11-protected-branches-api) for full details.
320-
321-
To access the API during the preview period, you must provide a custom[media type](/v3/media) in the`Accept` header:
322-
323-
application/vnd.github.loki-preview+json
324-
325-
{{/tip}}
326-
327-
Protecting a branch requires admin access.
328-
329-
PATCH /repos/:owner/:repo/branches/:branch
330-
331-
###Input
332-
333-
You need to pass a`protection` object.
334-
335-
Name | Type | Description
336-
-----|------|-------------
337-
`enabled`|`boolean` |**Required**. Should this branch be protected or not
338-
`required_status_checks`|`object`| Configure required status checks here
339-
340-
The`required_status_checks` object must have the following keys:
341-
342-
Name | Type | Description
343-
-----|------|-------------
344-
`enforcement_level`|`string` |**Required**. Who required status checks apply to. Options are`off`,`non_admins` or`everyone`.
345-
`contexts`|`array` |**Required**. The list of status checks to require in order to merge into this branch
346-
347-
The`enforcement_level` key can have the following values:
348-
349-
Name | Description
350-
------|------------
351-
`off` | Turn off required status checks for this branch.
352-
`non_admins` | Required status checks will be enforced for non-admins.
353-
`everyone` | Required status checks will be enforced for everyone (including admins).
354-
355-
####Example
356-
357-
<%= json\
358-
"protection" => {
359-
"enabled" => true,
360-
"required_status_checks" => {
361-
"enforcement_level" => "everyone",
362-
"contexts" =>["continuous-integration/travis-ci"]
363-
}
364-
}
365-
%>
366-
367-
{% endif %}
368-
369253
##Delete a Repository
370254

371255
Deleting a repository requires admin access. If OAuth is used, the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp