-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #893 from repository-settings/config-docs
- Loading branch information
Showing
8 changed files
with
229 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Branches | ||
|
||
https://docs.github.com/en/rest/reference/repos#update-branch-protection | ||
|
||
> [!IMPORTANT] | ||
> Each top-level element under branch protection must be filled (eg: | ||
`required_pull_request_reviews`, `required_status_checks`, `enforce_admins` and | ||
`restrictions`). | ||
If you don't want to use one of them you must set it to `null` (see comments in | ||
the example above). | ||
Otherwise, none of the settings will be applied. | ||
|
||
```yaml | ||
branches: | ||
- name: master | ||
# Branch Protection settings. Set to null to disable | ||
protection: | ||
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable. | ||
required_pull_request_reviews: | ||
# The number of approvals required. (1-6) | ||
required_approving_review_count: 1 | ||
# Dismiss approved reviews automatically when a new commit is pushed. | ||
dismiss_stale_reviews: true | ||
# Blocks merge until code owners have reviewed. | ||
require_code_owner_reviews: true | ||
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories. | ||
dismissal_restrictions: | ||
users: [] | ||
teams: [] | ||
# Required. Require status checks to pass before merging. Set to null to disable | ||
required_status_checks: | ||
# Required. Require branches to be up to date before merging. | ||
strict: true | ||
# Required. The list of status checks to require in order to merge into this branch | ||
contexts: [] | ||
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable. | ||
enforce_admins: true | ||
# Prevent merge commits from being pushed to matching branches | ||
required_linear_history: true | ||
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable. | ||
restrictions: | ||
apps: [] | ||
users: [] | ||
teams: [] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Collaborators | ||
|
||
https://docs.github.com/en/rest/collaborators/collaborators | ||
|
||
```yaml | ||
collaborators: | ||
- username: bkeepers | ||
permission: push | ||
- username: hubot | ||
permission: pull | ||
|
||
# Note: `permission` is only valid on organization-owned repositories. | ||
# The permission to grant the collaborator. Can be one of: | ||
# * `pull` - can pull, but not push to or administer this repository. | ||
# * `push` - can pull and push, but not administer this repository. | ||
# * `admin` - can pull, push and administer this repository. | ||
# * `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. | ||
# * `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Environments | ||
|
||
|
||
See https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment for available options. | ||
|
||
> [!IMPORTANT] | ||
> `deployment_branch_policy` differs from the API for ease of use. | ||
Either `protected_branches` (boolean) OR `custom_branches` (array of strings) can be provided; | ||
this will manage the API requirements under the hood. | ||
> | ||
> See https://docs.github.com/en/rest/deployments/branch-policies for documentation of `custom_branches`. | ||
If both are provided in an unexpected manner, `protected_branches` will be used. | ||
> | ||
> Either removing or simply not setting `deployment_branch_policy` will restore the default 'All branches' setting. | ||
```markdown | ||
environments: | ||
- name: production | ||
wait_timer: 5 | ||
reviewers: | ||
- id: 1 | ||
type: 'Team' | ||
- id: 2 | ||
type: 'User' | ||
deployment_branch_policy: | ||
protected_branches: true | ||
- name: development | ||
deployment_branch_policy: | ||
custom_branches: | ||
- main | ||
- dev/* | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Labels | ||
|
||
> [!NOTE] | ||
> Label color can start with `#`, e.g. `color: '#F341B2'`. | ||
> [!IMPORTANT] | ||
> If including the `#`, make sure to wrap it with quotes since it would otherwise be treated as a yaml comment! | ||
```yaml | ||
labels: | ||
- name: bug | ||
color: CC0000 | ||
description: An issue with the system 🐛. | ||
|
||
- name: feature | ||
# If including a `#`, make sure to wrap it with quotes! | ||
color: '#336699' | ||
description: New functionality. | ||
|
||
- name: Help Wanted | ||
# Provide a new name to rename an existing label | ||
new_name: first-timers-only | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Milestones | ||
|
||
https://docs.github.com/en/rest/issues/milestones#update-a-milestone | ||
|
||
```yaml | ||
milestones: | ||
- title: milestone-title | ||
description: milestone-description | ||
# The state of the milestone. Either `open` or `closed` | ||
state: open | ||
``` |
Oops, something went wrong.