1
0
mirror of synced 2025-12-22 03:16:52 -05:00

Merge branch 'main' into patch-1

This commit is contained in:
Janice
2020-11-06 14:08:13 -07:00
committed by GitHub
63 changed files with 686 additions and 319 deletions

11
.editorconfig Normal file
View File

@@ -0,0 +1,11 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@@ -5,7 +5,7 @@
module.exports = [ module.exports = [
'actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16', //actions/cache@v2.1.2 'actions/cache@d1255ad9362389eac595a9ae406b8e8cb3331f16', //actions/cache@v2.1.2
'actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675', //actions/checkout@v2.3.3 'actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f', //actions/checkout@v2.3.4
'actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9', //actions/script@v3.0.0 'actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9', //actions/script@v3.0.0
'actions/labeler@5f867a63be70efff62b767459b009290364495eb', //actions/labeler@v2.2.0 'actions/labeler@5f867a63be70efff62b767459b009290364495eb', //actions/labeler@v2.2.0
'actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d', //actions/setup-node@v1.4.4 'actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d', //actions/setup-node@v1.4.4

View File

@@ -26,7 +26,7 @@ jobs:
# Even if if doesn't do anything # Even if if doesn't do anything
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }} - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Checkout name: Checkout
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }} - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Install name: Install

View File

@@ -10,7 +10,7 @@ jobs:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: npm run build - name: npm run build

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: github/codeql-action/init@v1 - uses: github/codeql-action/init@v1
with: with:
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!) languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Sync - name: Sync
uses: crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688 uses: crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d - uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with: with:
node-version: 14.x node-version: 14.x

View File

@@ -29,7 +29,7 @@ jobs:
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }} if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Setup node - name: Setup node
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d

View File

@@ -1,10 +1,11 @@
name: Merged notification
on: on:
pull_request_target: pull_request_target:
types: ['closed'] types: ['closed']
jobs: jobs:
comment: comment:
if: github.event.repository.private == false && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch if: github.repository == 'github/docs' && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9

View File

@@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache id: npm-cache

View File

@@ -12,7 +12,7 @@ jobs:
env: env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }} HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
steps: steps:
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: npm run build - name: npm run build

View File

@@ -18,7 +18,7 @@ jobs:
echo 'The repo is currently frozen! Exiting this workflow.' echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running exit 1 # prevents further steps from running
- name: Checkout - name: Checkout
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: Run scripts - name: Run scripts

View File

@@ -32,7 +32,7 @@ jobs:
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Sync repo to branch - name: Sync repo to branch
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88 uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d - uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with: with:
node-version: 14.x node-version: 14.x

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with: with:
ref: translations # check out the 'translations' branch ref: translations # check out the 'translations' branch
@@ -52,7 +52,7 @@ jobs:
test-group: [content, meta, rendering, routing, unit, links-and-images] test-group: [content, meta, rendering, routing, unit, links-and-images]
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Setup node - name: Setup node
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d

View File

@@ -19,7 +19,7 @@ jobs:
test-group: [content, meta, rendering, routing, unit, links-and-images] test-group: [content, meta, rendering, routing, unit, links-and-images]
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Setup node - name: Setup node
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d

View File

@@ -32,6 +32,7 @@ jobs:
test: test:
needs: see_if_should_skip needs: see_if_should_skip
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 60
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -41,7 +42,7 @@ jobs:
# Even if if doesn't do anything # Even if if doesn't do anything
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }} - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Check out repo name: Check out repo
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }} - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Setup node name: Setup node

View File

@@ -22,7 +22,7 @@ jobs:
echo 'The repo is currently frozen! Exiting this workflow.' echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running exit 1 # prevents further steps from running
- name: Checkout - name: Checkout
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Set up Ruby - name: Set up Ruby
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526 uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
with: with:

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -36,7 +36,8 @@ versions:
{% link_with_intro /managing-complex-workflows %} {% link_with_intro /managing-complex-workflows %}
{% link_with_intro /sharing-workflows-with-your-organization %} {% link_with_intro /sharing-workflows-with-your-organization %}
{% link_with_intro /security-hardening-for-github-actions %} {% link_with_intro /security-hardening-for-github-actions %}
{% link_with_intro /migrating-from-azure-pipelines-to-github-actions %}
{% link_with_intro /migrating-from-circleci-to-github-actions %} {% link_with_intro /migrating-from-circleci-to-github-actions %}
{% link_with_intro /migrating-from-gitlab-cicd-to-github-actions %} {% link_with_intro /migrating-from-gitlab-cicd-to-github-actions %}
{% link_with_intro /migrating-from-azure-pipelines-to-github-actions %}
{% link_with_intro /migrating-from-jenkins-to-github-actions %} {% link_with_intro /migrating-from-jenkins-to-github-actions %}
{% link_with_intro /migrating-from-travis-ci-to-github-actions %}

View File

@@ -0,0 +1,410 @@
---
title: Migrating from Travis CI to GitHub Actions
intro: '{% data variables.product.prodname_actions %} and Travis CI share multiple similarities, which helps make it relatively straightforward to migrate to {% data variables.product.prodname_actions %}.'
redirect_from:
- /actions/migrating-to-github-actions/migrating-from-travis-ci-to-github-actions
versions:
free-pro-team: '*'
enterprise-server: '>=2.22'
---
### Introduction
This guide helps you migrate from Travis CI to {% data variables.product.prodname_actions %}. It compares their concepts and syntax, describes the similarities, and demonstrates their different approaches to common tasks.
### Before you start
Before starting your migration to {% data variables.product.prodname_actions %}, it would be useful to become familiar with how it works:
- For a quick example that demonstrates a {% data variables.product.prodname_actions %} job, see "[Quickstart for {% data variables.product.prodname_actions %}](/actions/quickstart)."
- To learn the essential {% data variables.product.prodname_actions %} concepts, see "[Introduction to GitHub Actions](/actions/learn-github-actions/introduction-to-github-actions)."
### Comparing job execution
To give you control over when CI tasks are executed, a {% data variables.product.prodname_actions %} _workflow_ uses _jobs_ that run in parallel by default. Each job contains _steps_ that are executed in a sequence that you define. If you need to run setup and cleanup actions for a job, you can define steps in each job to perform these.
### Key similarities
{% data variables.product.prodname_actions %} and Travis CI share certain similarities, and understanding these ahead of time can help smooth the migration process.
#### Using YAML syntax
Travis CI and {% data variables.product.prodname_actions %} both use YAML to create jobs and workflows, and these files are stored in the code's repository. For more information on how {% data variables.product.prodname_actions %} uses YAML, see ["Creating a workflow file](/actions/learn-github-actions/introduction-to-github-actions#create-an-example-workflow)."
#### Custom environment variables
Travis CI lets you set environment variables and share them between stages. Similarly, {% data variables.product.prodname_actions %} lets you define environment variables for a step, job, or workflow. For more information, see ["Environment variables](/actions/reference/environment-variables)."
#### Default environment variables
Travis CI and {% data variables.product.prodname_actions %} both include default environment variables that you can use in your YAML files. For {% data variables.product.prodname_actions %}, you can see these listed in "[Default environment variables](/actions/reference/environment-variables#default-environment-variables)."
#### Parallel job processing
Travis CI can use `stages` to run jobs in parallel. Similarly, {% data variables.product.prodname_actions %} runs `jobs` in parallel. For more information, see "[Creating dependent jobs](/actions/learn-github-actions/managing-complex-workflows#creating-dependent-jobs)."
#### Status badges
Travis CI and {% data variables.product.prodname_actions %} both support status badges, which let you indicate whether a build is passing or failing.
For more information, see ["Adding a workflow status badge to your repository](/actions/managing-workflow-runs/adding-a-workflow-status-badge)."
#### Using a build matrix
Travis CI and {% data variables.product.prodname_actions %} both support a build matrix, allowing you to perform testing using combinations of operating systems and software packages. For more information, see "[Using a build matrix](/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix)."
Below is an example comparing the syntax for each system:
<table>
<tr>
<th>
Travis CI
</th>
<th>
{% data variables.product.prodname_actions %}
</th>
</tr>
<tr>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
matrix:
include:
- rvm: 2.5
- rvm: 2.6.3
```
{% endraw %}
</td>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
jobs:
build:
strategy:
matrix:
ruby: [2.5, 2.6.3]
```
{% endraw %}
</td>
</tr>
</table>
#### Targeting specific branches
Travis CI and {% data variables.product.prodname_actions %} both allow you to target your CI to a specific branch. For more information, see "[Workflow syntax for GitHub Actions](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags)."
Below is an example of the syntax for each system:
<table>
<tr>
<th>
Travis CI
</th>
<th>
{% data variables.product.prodname_actions %}
</th>
</tr>
<tr>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
branches:
only:
- main
- 'mona/octocat'
```
{% endraw %}
</td>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
on:
push:
branches:
- main
- 'mona/octocat'
```
{% endraw %}
</td>
</tr>
</table>
#### Checking out submodules
Travis CI and {% data variables.product.prodname_actions %} both allow you to control whether submodules are included in the repository clone.
Below is an example of the syntax for each system:
<table>
<tr>
<th>
Travis CI
</th>
<th>
{% data variables.product.prodname_actions %}
</th>
</tr>
<tr>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
git:
submodules: false
```
{% endraw %}
</td>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
- uses: actions/checkout@v2
with:
submodules: false
```
{% endraw %}
</td>
</tr>
</table>
### Key features in {% data variables.product.prodname_actions %}
When migrating from Travis CI, consider the following key features in {% data variables.product.prodname_actions %}:
#### Storing secrets
{% data variables.product.prodname_actions %} allows you to store secrets and reference them in your jobs. {% data variables.product.prodname_actions %} also includes policies that allow you to limit access to secrets at the repository and organization level. For more information, see "[Encrypted secrets](/actions/reference/encrypted-secrets)."
#### Sharing files between jobs and workflows
{% data variables.product.prodname_actions %} includes integrated support for artifact storage, allowing you to share files between jobs in a workflow. You can also save the resulting files and share them with other workflows. For more information, see "[Sharing data between jobs](/actions/learn-github-actions/essential-features-of-github-actions#sharing-data-between-jobs)."
#### Hosting your own runners
If your jobs require specific hardware or software, {% data variables.product.prodname_actions %} allows you to host your own runners and send your jobs to them for processing. {% data variables.product.prodname_actions %} also lets you use policies to control how these runners are accessed, granting access at the organization or repository level. For more information, see ["Hosting your own runners](/actions/hosting-your-own-runners)."
#### Concurrent jobs and execution time
The concurrent jobs and workflow execution times in {% data variables.product.prodname_actions %} can vary depending on your {% data variables.product.company_short %} plan. For more information, see "[Usage limits, billing, and administration](/actions/reference/usage-limits-billing-and-administration)."
#### Using different languages in {% data variables.product.prodname_actions %}
When working with different languages in {% data variables.product.prodname_actions %}, you can create a step in your job to set up your language dependencies. For more information about working with a particular language, see the specific guide:
- [Building and testing Node.js](/actions/guides/building-and-testing-nodejs)
- [Building and testing PowerShell](/actions/guides/building-and-testing-powershell)
- [Building and testing Python](/actions/guides/building-and-testing-python)
- [Building and testing Java with Maven](/actions/guides/building-and-testing-java-with-maven)
- [Building and testing Java with Gradle](/actions/guides/building-and-testing-java-with-gradle)
- [Building and testing Java with Ant](/actions/guides/building-and-testing-java-with-ant)
### Executing scripts
{% data variables.product.prodname_actions %} can use `run` steps to run scripts or shell commands. To use a particular shell, you can specify the `shell` type when providing the path to the script. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun)."
For example:
```yaml
steps:
- name: Run build script
run: ./.github/scripts/build.sh
shell: bash
```
### Error handling in {% data variables.product.prodname_actions %}
When migrating to {% data variables.product.prodname_actions %}, there are different approaches to error handling that you might need to be aware of.
#### Script error handling
{% data variables.product.prodname_actions %} stops a job immediately if one of the steps returns an error code. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference)."
#### Job error handling
{% data variables.product.prodname_actions %} uses `if` conditionals to execute jobs or steps in certain situations. For example, you can run a step when another step results in a `failure()`. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#example-using-status-check-functions)." You can also use [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error) to prevent a workflow run from stopping when a job fails.
### Migrating syntax for conditionals and expressions
To run jobs under conditional expressions, Travis CI and {% data variables.product.prodname_actions %} share a similar `if` condition syntax. {% data variables.product.prodname_actions %} lets you use the `if` conditional to prevent a job or step from running unless a condition is met. For more information, see "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)."
This example demonstrates how an `if` conditional can control whether a step is executed:
```yaml
jobs:
conditional:
runs-on: ubuntu-latest
steps:
- run: echo "This step runs with str equals 'ABC' and num equals 123"
if: env.str == 'ABC' && env.num == 123
```
### Migrating phases to steps
Where Travis CI uses _phases_ to run _steps_, {% data variables.product.prodname_actions %} has _steps_ which execute _actions_. You can find prebuilt actions in the [{% data variables.product.prodname_marketplace %}](https://github.com/marketplace?type=actions), or you can create your own actions. For more information, see "[Building actions](/actions/building-actions)."
Below is an example of the syntax for each system:
<table>
<tr>
<th>
Travis CI
</th>
<th>
{% data variables.product.prodname_actions %}
</th>
</tr>
<tr>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
language: python
python:
- "3.7"
script:
- python script.py
```
{% endraw %}
</td>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
jobs:
run_python:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'
- run: python script.py
```
{% endraw %}
</td>
</tr>
</table>
### Caching dependencies
Travis CI and {% data variables.product.prodname_actions %} let you manually cache dependencies for later reuse. This example demonstrates the cache syntax for each system.
<table>
<tr>
<th>
Travis CI
</th>
<th>
GitHub Actions
</th>
</tr>
<tr>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
language: node_js
cache: npm
```
{% endraw %}
</td>
<td class="d-table-cell v-align-top">
{% raw %}
```yaml
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
restore-keys: v1-npm-deps-
```
{% endraw %}
</td>
</tr>
</table>
For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
### Examples of common tasks
This section compares how {% data variables.product.prodname_actions %} and Travis CI perform common tasks.
#### Configuring environment variables
You can create custom environment variables in a {% data variables.product.prodname_actions %} job. For example:
<table>
<tr>
<th>
Travis CI
</th>
<th>
{% data variables.product.prodname_actions %} Workflow
</th>
</tr>
<tr>
<td>
```yaml
env:
- MAVEN_PATH="/usr/local/maven"
```
</td>
<td>
```yaml
jobs:
maven-build:
env:
MAVEN_PATH: '/usr/local/maven'
```
</td>
</tr>
</table>
#### Building with Node.js
<table>
<tr>
<th>
Travis CI
</th>
<th>
{% data variables.product.prodname_actions %} Workflow
</th>
</tr>
<tr>
<td>
{% raw %}
```yaml
install:
- npm install
script:
- npm run build
- npm test
```
{% endraw %}
</td>
<td>
{% raw %}
```yaml
name: Node.js CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install
- run: npm run build
- run: npm test
```
{% endraw %}
</td>
</tr>
</table>
### Next steps
To continue learning about the main features of {% data variables.product.prodname_actions %}, see "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)."

View File

@@ -33,26 +33,34 @@ You can configure [Nagios](https://www.nagios.org/) to monitor {% data variables
#### Configuring the Nagios host #### Configuring the Nagios host
1. Generate an SSH key with a blank passphrase. Nagios uses this to authenticate to the {% data variables.product.prodname_ghe_server %} cluster. 1. Generate an SSH key with a blank passphrase. Nagios uses this to authenticate to the {% data variables.product.prodname_ghe_server %} cluster.
```shell ```shell
nagiosuser@nagios:~$ <em>ssh-keygen -t rsa -b 4096</em> nagiosuser@nagios:~$ <em>ssh-keygen -t ed25519</em>
> Generating public/private rsa key pair. > Generating public/private ed25519 key pair.
> Enter file in which to save the key (/home/nagiosuser/.ssh/id_rsa): > Enter file in which to save the key (/home/nagiosuser/.ssh/id_ed25519):
> Enter passphrase (empty for no passphrase): <em>leave blank by pressing enter</em> > Enter passphrase (empty for no passphrase): <em>leave blank by pressing enter</em>
> Enter same passphrase again: <em>press enter again</em> > Enter same passphrase again: <em>press enter again</em>
> Your identification has been saved in /home/nagiosuser/.ssh/id_rsa. > Your identification has been saved in /home/nagiosuser/.ssh/id_ed25519.
> Your public key has been saved in /home/nagiosuser/.ssh/id_rsa.pub. > Your public key has been saved in /home/nagiosuser/.ssh/id_ed25519.pub.
``` ```
{% danger %} {% danger %}
**Security Warning:** An SSH key without a passphrase can pose a security risk if authorized for full access to a host. Limit this key's authorization to a single read-only command. **Security Warning:** An SSH key without a passphrase can pose a security risk if authorized for full access to a host. Limit this key's authorization to a single read-only command.
{% enddanger %} {% enddanger %}
2. Copy the private key (`id_rsa`) to the `nagios` home folder and set the appropriate ownership. {% note %}
**Note:** If you're using a distribution of Linux that doesn't support the Ed25519 algorithm, use the command:
```shell ```shell
nagiosuser@nagios:~$ <em>sudo cp .ssh/id_rsa /var/lib/nagios/.ssh/</em> nagiosuser@nagios:~$ ssh-keygen -t rsa -b 4096
nagiosuser@nagios:~$ <em>sudo chown nagios:nagios /var/lib/nagios/.ssh/id_rsa</em>
``` ```
3. To authorize the public key to run *only* the `ghe-cluster-status -n` command, use a `command=` prefix in the `/data/user/common/authorized_keys` file. From the administrative shell on any node, modify this file to add the public key generated in step 1. For example: `command="/usr/local/bin/ghe-cluster-status -n" ssh-rsa AAAA....` {% endnote %}
2. Copy the private key (`id_ed25519`) to the `nagios` home folder and set the appropriate ownership.
```shell
nagiosuser@nagios:~$ <em>sudo cp .ssh/id_ed25519 /var/lib/nagios/.ssh/</em>
nagiosuser@nagios:~$ <em>sudo chown nagios:nagios /var/lib/nagios/.ssh/id_ed25519</em>
```
3. To authorize the public key to run *only* the `ghe-cluster-status -n` command, use a `command=` prefix in the `/data/user/common/authorized_keys` file. From the administrative shell on any node, modify this file to add the public key generated in step 1. For example: `command="/usr/local/bin/ghe-cluster-status -n" ssh-ed25519 AAAA....`
4. Validate and copy the configuration to each node in the cluster by running `ghe-cluster-config-apply` on the node where you modified the `/data/user/common/authorized_keys` file. 4. Validate and copy the configuration to each node in the cluster by running `ghe-cluster-config-apply` on the node where you modified the `/data/user/common/authorized_keys` file.

View File

@@ -103,8 +103,8 @@ You can test a pre-receive hook script locally before you create or update it on
adduser git -D -G root -h /home/git -s /bin/bash && \ adduser git -D -G root -h /home/git -s /bin/bash && \
passwd -d git && \ passwd -d git && \
su git -c "mkdir /home/git/.ssh && \ su git -c "mkdir /home/git/.ssh && \
ssh-keygen -t rsa -b 4096 -f /home/git/.ssh/id_rsa -P '' && \ ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P '' && \
mv /home/git/.ssh/id_rsa.pub /home/git/.ssh/authorized_keys && \ mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && \
mkdir /home/git/test.git && \ mkdir /home/git/test.git && \
git --bare init /home/git/test.git" git --bare init /home/git/test.git"
@@ -136,7 +136,7 @@ You can test a pre-receive hook script locally before you create or update it on
> Sending build context to Docker daemon 3.584 kB > Sending build context to Docker daemon 3.584 kB
> Step 1 : FROM gliderlabs/alpine:3.3 > Step 1 : FROM gliderlabs/alpine:3.3
> ---> 8944964f99f4 > ---> 8944964f99f4
> Step 2 : RUN apk add --no-cache git openssh bash && ssh-keygen -A && sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && adduser git -D -G root -h /home/git -s /bin/bash && passwd -d git && su git -c "mkdir /home/git/.ssh && ssh-keygen -t rsa -b 4096 -f /home/git/.ssh/id_rsa -P ' && mv /home/git/.ssh/id_rsa.pub /home/git/.ssh/authorized_keys && mkdir /home/git/test.git && git --bare init /home/git/test.git" > Step 2 : RUN apk add --no-cache git openssh bash && ssh-keygen -A && sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && adduser git -D -G root -h /home/git -s /bin/bash && passwd -d git && su git -c "mkdir /home/git/.ssh && ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P ' && mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && mkdir /home/git/test.git && git --bare init /home/git/test.git"
> ---> Running in e9d79ab3b92c > ---> Running in e9d79ab3b92c
> fetch http://alpine.gliderlabs.com/alpine/v3.3/main/x86_64/APKINDEX.tar.gz > fetch http://alpine.gliderlabs.com/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
> fetch http://alpine.gliderlabs.com/alpine/v3.3/community/x86_64/APKINDEX.tar.gz > fetch http://alpine.gliderlabs.com/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
@@ -144,9 +144,9 @@ You can test a pre-receive hook script locally before you create or update it on
> OK: 34 MiB in 26 packages > OK: 34 MiB in 26 packages
> ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 > ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
> Password for git changed by root > Password for git changed by root
> Generating public/private rsa key pair. > Generating public/private ed25519 key pair.
> Your identification has been saved in /home/git/.ssh/id_rsa. > Your identification has been saved in /home/git/.ssh/id_ed25519.
> Your public key has been saved in /home/git/.ssh/id_rsa.pub. > Your public key has been saved in /home/git/.ssh/id_ed25519.pub.
....truncated output.... ....truncated output....
> Initialized empty Git repository in /home/git/test.git/ > Initialized empty Git repository in /home/git/test.git/
> Successfully built dd8610c24f82 > Successfully built dd8610c24f82
@@ -174,7 +174,7 @@ You can test a pre-receive hook script locally before you create or update it on
9. Copy the generated SSH key from the data container to the local machine: 9. Copy the generated SSH key from the data container to the local machine:
```shell ```shell
$ docker cp data:/home/git/.ssh/id_rsa . $ docker cp data:/home/git/.ssh/id_ed25519 .
``` ```
10. Modify the remote of a test repository and push to the `test.git` repo within the Docker container. This example uses `git@github.com:octocat/Hello-World.git` but you can use any repo you want. This example assumes your local machine (127.0.0.1) is binding port 52311, but you can use a different IP address if docker is running on a remote machine. 10. Modify the remote of a test repository and push to the `test.git` repo within the Docker container. This example uses `git@github.com:octocat/Hello-World.git` but you can use any repo you want. This example assumes your local machine (127.0.0.1) is binding port 52311, but you can use a different IP address if docker is running on a remote machine.
@@ -183,7 +183,7 @@ You can test a pre-receive hook script locally before you create or update it on
$ git clone git@github.com:octocat/Hello-World.git $ git clone git@github.com:octocat/Hello-World.git
$ cd Hello-World $ cd Hello-World
$ git remote add test git@127.0.0.1:test.git $ git remote add test git@127.0.0.1:test.git
$ GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 52311 -i ../id_rsa" git push -u test main $ GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 52311 -i ../id_ed25519" git push -u test main
> Warning: Permanently added '[192.168.99.100]:52311' (ECDSA) to the list of known hosts. > Warning: Permanently added '[192.168.99.100]:52311' (ECDSA) to the list of known hosts.
> Counting objects: 7, done. > Counting objects: 7, done.
> Delta compression using up to 4 threads. > Delta compression using up to 4 threads.

View File

@@ -20,6 +20,7 @@ You can block a user in your account settings or from the user's profile. {% dat
When you block a user: When you block a user:
- The user stops following you - The user stops following you
- The user stops watching and unpins your repositories - The user stops watching and unpins your repositories
- The user is not able to join any organizations you are an owner of
- The user's stars and issue assignments are removed from your repositories - The user's stars and issue assignments are removed from your repositories
- The user's forks of your repositories are deleted - The user's forks of your repositories are deleted
- You delete any forks of the user's repositories - You delete any forks of the user's repositories

View File

@@ -5,6 +5,7 @@ product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from: redirect_from:
- /articles/about-github-business-accounts/ - /articles/about-github-business-accounts/
- /articles/about-enterprise-accounts - /articles/about-enterprise-accounts
- /github/setting-up-and-managing-your-enterprise-account/about-enterprise-accounts
versions: versions:
free-pro-team: '*' free-pro-team: '*'
enterprise-server: '*' enterprise-server: '*'

View File

@@ -4,6 +4,7 @@ intro: You can create new organizations to manage within your enterprise account
product: '{% data reusables.gated-features.enterprise-accounts %}' product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from: redirect_from:
- /articles/adding-organizations-to-your-enterprise-account - /articles/adding-organizations-to-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/adding-organizations-to-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -4,6 +4,7 @@ intro: 'You can use Security Assertion Markup Language (SAML) single sign-on (SS
product: '{% data reusables.gated-features.enterprise-accounts %}' product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from: redirect_from:
- /github/setting-up-and-managing-your-enterprise/configuring-single-sign-on-and-scim-for-your-enterprise-account-using-okta - /github/setting-up-and-managing-your-enterprise/configuring-single-sign-on-and-scim-for-your-enterprise-account-using-okta
- /github/setting-up-and-managing-your-enterprise-account/configuring-saml-single-sign-on-and-scim-for-your-enterprise-account-using-okta
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -2,6 +2,8 @@
title: Configuring the retention period for GitHub Actions artifacts and logs in your enterprise account title: Configuring the retention period for GitHub Actions artifacts and logs in your enterprise account
intro: 'Enterprise owners can configure the retention period for {% data variables.product.prodname_actions %} artifacts and logs in an enterprise account.' intro: 'Enterprise owners can configure the retention period for {% data variables.product.prodname_actions %} artifacts and logs in an enterprise account.'
product: '{% data reusables.gated-features.enterprise-accounts %}' product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from:
- /github/setting-up-and-managing-your-enterprise-account/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-enterprise-account
miniTocMaxHeadingLevel: 4 miniTocMaxHeadingLevel: 4
versions: versions:
free-pro-team: '*' free-pro-team: '*'

View File

@@ -5,6 +5,7 @@ product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from: redirect_from:
- /articles/configuring-webhooks-for-organization-events-in-your-business-account/ - /articles/configuring-webhooks-for-organization-events-in-your-business-account/
- /articles/configuring-webhooks-for-organization-events-in-your-enterprise-account - /articles/configuring-webhooks-for-organization-events-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/configuring-webhooks-for-organization-events-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -5,6 +5,7 @@ product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from: redirect_from:
- /articles/enforcing-a-policy-on-dependency-insights/ - /articles/enforcing-a-policy-on-dependency-insights/
- /articles/enforcing-a-policy-on-dependency-insights-in-your-enterprise-account - /articles/enforcing-a-policy-on-dependency-insights-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/enforcing-a-policy-on-dependency-insights-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -2,6 +2,8 @@
title: Enforcing GitHub Actions policies in your enterprise account title: Enforcing GitHub Actions policies in your enterprise account
intro: 'Enterprise owners can disable, enable, and limit {% data variables.product.prodname_actions %} for an enterprise account.' intro: 'Enterprise owners can disable, enable, and limit {% data variables.product.prodname_actions %} for an enterprise account.'
product: '{% data reusables.gated-features.enterprise-accounts %}' product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from:
- /github/setting-up-and-managing-your-enterprise-account/enforcing-github-actions-policies-in-your-enterprise-account
miniTocMaxHeadingLevel: 4 miniTocMaxHeadingLevel: 4
versions: versions:
free-pro-team: '*' free-pro-team: '*'

View File

@@ -6,6 +6,7 @@ redirect_from:
- /articles/enforcing-project-board-settings-for-organizations-in-your-business-account/ - /articles/enforcing-project-board-settings-for-organizations-in-your-business-account/
- /articles/enforcing-project-board-policies-for-organizations-in-your-enterprise-account/ - /articles/enforcing-project-board-policies-for-organizations-in-your-enterprise-account/
- /articles/enforcing-project-board-policies-in-your-enterprise-account - /articles/enforcing-project-board-policies-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/enforcing-project-board-policies-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -6,6 +6,7 @@ redirect_from:
- /articles/enforcing-repository-management-settings-for-organizations-in-your-business-account/ - /articles/enforcing-repository-management-settings-for-organizations-in-your-business-account/
- /articles/enforcing-repository-management-policies-for-organizations-in-your-enterprise-account/ - /articles/enforcing-repository-management-policies-for-organizations-in-your-enterprise-account/
- /articles/enforcing-repository-management-policies-in-your-enterprise-account - /articles/enforcing-repository-management-policies-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/enforcing-repository-management-policies-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -8,6 +8,7 @@ redirect_from:
- /articles/enforcing-security-settings-for-organizations-in-your-enterprise-account/ - /articles/enforcing-security-settings-for-organizations-in-your-enterprise-account/
- /articles/enforcing-security-settings-in-your-enterprise-account - /articles/enforcing-security-settings-in-your-enterprise-account
- /github/articles/managing-allowed-ip-addresses-for-organizations-in-your-enterprise-account - /github/articles/managing-allowed-ip-addresses-for-organizations-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/enforcing-security-settings-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -6,6 +6,7 @@ redirect_from:
- /articles/enforcing-team-settings-for-organizations-in-your-business-account/ - /articles/enforcing-team-settings-for-organizations-in-your-business-account/
- /articles/enforcing-team-policies-for-organizations-in-your-enterprise-account/ - /articles/enforcing-team-policies-for-organizations-in-your-enterprise-account/
- /articles/enforcing-team-policies-in-your-enterprise-account - /articles/enforcing-team-policies-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/enforcing-team-policies-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -5,6 +5,7 @@ redirect_from:
- /github/setting-up-and-managing-your-enterprise/managing-licenses-for-the-github-enterprise-and-visual-studio-bundle - /github/setting-up-and-managing-your-enterprise/managing-licenses-for-the-github-enterprise-and-visual-studio-bundle
- /github/articles/about-the-github-and-visual-studio-bundle - /github/articles/about-the-github-and-visual-studio-bundle
- /articles/about-the-github-and-visual-studio-bundle - /articles/about-the-github-and-visual-studio-bundle
- /github/setting-up-and-managing-your-enterprise-account/managing-licenses-for-visual-studio-subscription-with-github-enterprise
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -4,7 +4,7 @@ product: '{% data reusables.gated-features.enterprise-accounts %}'
mapTopic: true mapTopic: true
redirect_from: redirect_from:
- /articles/managing-organizations-in-your-enterprise-account - /articles/managing-organizations-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/managing-organizations-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -3,6 +3,8 @@ title: Managing unowned organizations in your enterprise account
intro: You can become an owner of an organization in your enterprise account that currently has no owners. intro: You can become an owner of an organization in your enterprise account that currently has no owners.
product: '{% data reusables.gated-features.enterprise-accounts %}' product: '{% data reusables.gated-features.enterprise-accounts %}'
permissions: Enterprise owners can manage unowned organizations in an enterprise account. permissions: Enterprise owners can manage unowned organizations in an enterprise account.
redirect_from:
- /github/setting-up-and-managing-your-enterprise-account/managing-unowned-organizations-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -4,6 +4,7 @@ product: '{% data reusables.gated-features.enterprise-accounts %}'
mapTopic: true mapTopic: true
redirect_from: redirect_from:
- /github/setting-up-and-managing-your-enterprise/managing-users-in-your-enterprise-account - /github/setting-up-and-managing-your-enterprise/managing-users-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/managing-users-in-your-enterprise-account
- /articles/managing-users-in-your-enterprise-account - /articles/managing-users-in-your-enterprise-account
- /articles/managing-users-in-your-enterprise - /articles/managing-users-in-your-enterprise
versions: versions:
@@ -11,4 +12,3 @@ versions:
enterprise-server: '*' enterprise-server: '*'
github-ae: '*' github-ae: '*'
--- ---

View File

@@ -4,7 +4,7 @@ product: '{% data reusables.gated-features.enterprise-accounts %}'
mapTopic: true mapTopic: true
redirect_from: redirect_from:
- /articles/setting-policies-for-organizations-in-your-enterprise-account - /articles/setting-policies-for-organizations-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/setting-policies-for-organizations-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -5,6 +5,7 @@ permissions: Enterprise owners can view and manage a member's SAML access to an
product: '{% data reusables.gated-features.enterprise-accounts %}' product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from: redirect_from:
- /github/setting-up-and-managing-your-enterprise/viewing-and-managing-a-users-saml-access-to-your-enterprise-account - /github/setting-up-and-managing-your-enterprise/viewing-and-managing-a-users-saml-access-to-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/viewing-and-managing-a-users-saml-access-to-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -5,6 +5,7 @@ product: '{% data reusables.gated-features.enterprise-accounts %}'
redirect_from: redirect_from:
- /articles/viewing-the-audit-logs-for-organizations-in-your-business-account/ - /articles/viewing-the-audit-logs-for-organizations-in-your-business-account/
- /articles/viewing-the-audit-logs-for-organizations-in-your-enterprise-account - /articles/viewing-the-audit-logs-for-organizations-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/viewing-the-audit-logs-for-organizations-in-your-enterprise-account
versions: versions:
free-pro-team: '*' free-pro-team: '*'
--- ---

View File

@@ -5,9 +5,7 @@ product: '{% data reusables.gated-features.github-insights %}'
redirect_from: redirect_from:
- /github/installing-and-configuring-github-insights/github-insights-and-data-protection-for-your-organization - /github/installing-and-configuring-github-insights/github-insights-and-data-protection-for-your-organization
versions: versions:
free-pro-team: '*'
enterprise-server: '*' enterprise-server: '*'
github-ae: '*'
--- ---
For more information about the terms that govern {% data variables.product.prodname_insights %}, see your {% data variables.product.prodname_ghe_one %} subscription agreement. For more information about the terms that govern {% data variables.product.prodname_insights %}, see your {% data variables.product.prodname_ghe_one %} subscription agreement.

View File

@@ -194,7 +194,6 @@ In addition to the non-public user account information and account access logs m
- Any security keys used for authentication or encryption - Any security keys used for authentication or encryption
- <a name="in-exigent-circumstances"></a> - <a name="in-exigent-circumstances"></a>
**Under exigent circumstances** — **Under exigent circumstances** —
If we receive a request for information under certain exigent circumstances (where we believe the disclosure is necessary to prevent an emergency involving danger of death or serious physical injury to a person), we may disclose limited information that we determine necessary to enable law enforcement to address the emergency. For any information beyond that, we would require a subpoena, search warrant, or court order, as described above. For example, we will not disclose contents of private repositories without a search warrant. Before disclosing information, we confirm that the request came from a law enforcement agency, an authority sent an official notice summarizing the emergency, and how the information requested will assist in addressing the emergency. If we receive a request for information under certain exigent circumstances (where we believe the disclosure is necessary to prevent an emergency involving danger of death or serious physical injury to a person), we may disclose limited information that we determine necessary to enable law enforcement to address the emergency. For any information beyond that, we would require a subpoena, search warrant, or court order, as described above. For example, we will not disclose contents of private repositories without a search warrant. Before disclosing information, we confirm that the request came from a law enforcement agency, an authority sent an official notice summarizing the emergency, and how the information requested will assist in addressing the emergency.

View File

@@ -40,7 +40,7 @@ To set up a `www` or custom subdomain, such as `www.example.com` or `blog.exampl
{% data reusables.pages.navigate-site-repo %} {% data reusables.pages.navigate-site-repo %}
{% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.sidebar-settings %}
{% data reusables.pages.save-custom-domain %} {% data reusables.pages.save-custom-domain %}
5. Navigate to your DNS provider and create a `CNAME` record that points your subdomain to the default domain for your site. For example, if you want to use the subdomain `www.example.com` for your user site, create a `CNAME` record that points `www.example.com` to `<user>.github.io`. If you want to use the subdomain `www.anotherexample.com` for your organization site, create a `CNAME` record that points `www.anotherexample.com` to `<organization>.github.io`. The `CNAME` file should always point to `<user>.github.io` or `<organization>.github.io`, excluding the repository name. {% data reusables.pages.contact-dns-provider %}{% data reusables.pages.default-domain-information %} 5. Navigate to your DNS provider and create a `CNAME` record that points your subdomain to the default domain for your site. For example, if you want to use the subdomain `www.example.com` for your user site, create a `CNAME` record that points `www.example.com` to `<user>.github.io`. If you want to use the subdomain `www.anotherexample.com` for your organization site, create a `CNAME` record that points `www.anotherexample.com` to `<organization>.github.io`. The `CNAME` file should always point to `<user>.github.io` or `<organization>.github.io`, excluding the repository name. {% data reusables.pages.contact-dns-provider %} {% data reusables.pages.default-domain-information %}
{% data reusables.command_line.open_the_multi_os_terminal %} {% data reusables.command_line.open_the_multi_os_terminal %}
6. To confirm that your DNS record configured correctly, use the `dig` command, replacing _WWW.EXAMPLE.COM_ with your subdomain. 6. To confirm that your DNS record configured correctly, use the `dig` command, replacing _WWW.EXAMPLE.COM_ with your subdomain.
```shell ```shell

View File

@@ -81,15 +81,6 @@ Manage [projects](/v3/projects/).
**Custom media type:** `cloak-preview` **Custom media type:** `cloak-preview`
**Announced:** [2017-01-05](https://developer.github.com/changes/2017-01-05-commit-search-api/) **Announced:** [2017-01-05](https://developer.github.com/changes/2017-01-05-commit-search-api/)
{% if currentVersion == "free-pro-team@latest" %}
### Community profile metrics
Retrieve [community profile metrics](/v3/repos/community/) (also known as community health) for any public repository.
**Custom media type:** `black-panther-preview`
**Announced:** [2017-02-09](https://developer.github.com/changes/2017-02-09-community-health/)
{% endif %}
{% if currentVersion == "free-pro-team@latest" %} {% if currentVersion == "free-pro-team@latest" %}
### User blocking ### User blocking
@@ -235,17 +226,6 @@ You can now provide more information in GitHub for URLs that link to registered
**Custom media types:** `corsair-preview` **Custom media types:** `corsair-preview`
**Announced:** [2018-12-10](https://developer.github.com/changes/2018-12-10-content-attachments-api/) **Announced:** [2018-12-10](https://developer.github.com/changes/2018-12-10-content-attachments-api/)
{% if currentVersion == "free-pro-team@latest" %}
### Interaction restrictions for repositories and organizations
Allows you to temporarily restrict interactions, such as commenting, opening issues, and creating pull requests, for {% data variables.product.product_name %} repositories or organizations. When enabled, only the specified group of {% data variables.product.product_name %} users will be able to participate in these interactions. See the [Repository interactions](/v3/interactions/repos/) and [Organization interactions](/v3/interactions/orgs/) APIs for more details.
**Custom media type:** `sombra-preview`
**Announced:** [2018-12-18](https://developer.github.com/changes/2018-12-18-interactions-preview/)
{% endif %}
{% if enterpriseServerVersions contains currentVersion and currentVersion ver_lt "enterprise-server@2.21" %} {% if enterpriseServerVersions contains currentVersion and currentVersion ver_lt "enterprise-server@2.21" %}
### Draft pull requests ### Draft pull requests

View File

@@ -11,13 +11,12 @@ versions:
<div class="jumbotron libraries-jumbotron"> <div class="jumbotron libraries-jumbotron">
<img src="/assets/images/gundamcat.png" class="gundamcat" alt="The Gundamcat" /> <img src="/assets/images/gundamcat.png" class="gundamcat" alt="The Gundamcat" />
<h1>Octokit comes in<br /> <h1>Octokit comes in many flavors</h1>
many flavors</h1>
<p class="lead">Use the official Octokit library, or choose between any of the available third party libraries.</p> <p class="lead">Use the official Octokit library, or choose between any of the available third party libraries.</p>
<div class="octokit-links"> <div class="octokit-links"><br/>
<div class="octokit-language"><span>Ruby</span> <a href="https://github.com/octokit/octokit.rb">octokit.rb</a></div> <div class="octokit-language"> <span>Ruby</span><a href="https://github.com/octokit/octokit.rb">octokit.rb</a></div><br/>
<div class="octokit-language"><span>.NET</span> <a href="https://github.com/octokit/octokit.net">octokit.net</a></div> <div class="octokit-language"><span>.NET</span> <a href="https://github.com/octokit/octokit.net">octokit.net</a></div><br/>
<div class="octokit-language"><span>JavaScript</span> <a href="https://github.com/octokit/rest.js">octokit/rest.js</a></div> <div class="octokit-language"><span>JavaScript</span> <a href="https://github.com/octokit/rest.js">octokit/rest.js</a></div><br/>
</div> </div>
</div> </div>
@@ -25,141 +24,118 @@ versions:
### Clojure ### Clojure
* [Tentacles][tentacles] Library name | Repository
|---|---|
[tentacles]: https://github.com/Raynes/tentacles **Tentacles**| [Raynes/tentacles](https://github.com/Raynes/tentacles)
### Dart ### Dart
* [github.dart][github.dart] Library name | Repository
|---|---|
[github.dart]: https://github.com/DirectMyFile/github.dart **github.dart** | [DirectMyFile/github.dart](https://github.com/DirectMyFile/github.dart)
### Emacs Lisp ### Emacs Lisp
* [gh.el][gh.el] Library name | Repository
|---|---|
[gh.el]: https://github.com/sigma/gh.el **gh.el** | [sigma/gh.el](https://github.com/sigma/gh.el)
### Erlang ### Erlang
* [octo.erl][octo-erl] Library name | Repository
|---|---|
[octo-erl]: https://github.com/sdepold/octo.erl **octo-erl** | [sdepold/octo.erl](https://github.com/sdepold/octo.erl)
### Go ### Go
* [go-github][] Library name | Repository
|---|---|
[go-github]: https://github.com/google/go-github **go-github**| [google/go-github](https://github.com/google/go-github)
### Haskell ### Haskell
* [github][haskell-github] Library name | Repository
|---|---|
[haskell-github]: https://github.com/fpco/GitHub **haskell-github** | [fpco/Github](https://github.com/fpco/GitHub)
### Java ### Java
* The [GitHub Java API (org.eclipse.egit.github.core)](https://github.com/eclipse/egit-github/tree/master/org.eclipse.egit.github.core) library Library name | Repository | More information
is part of the [GitHub Mylyn Connector](https://github.com/eclipse/egit-github) and aims to support the entire |---|---|---|
GitHub v3 API. Builds are available in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22org.eclipse.egit.github.core%22). **GitHub Java API**| [org.eclipse.egit.github.core](https://github.com/eclipse/egit-github/tree/master/org.eclipse.egit.github.core) | Is part of the [GitHub Mylyn Connector](https://github.com/eclipse/egit-github) and aims to support the entire GitHub v3 API. Builds are available in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22org.eclipse.egit.github.core%22).
* [GitHub API for Java (org.kohsuke.github)](http://github-api.kohsuke.org/) defines an object oriented representation of the GitHub API. **GitHub API for Java**| [org.kohsuke.github (From github-api)](http://github-api.kohsuke.org/)|defines an object oriented representation of the GitHub API.
* [JCabi GitHub API](http://github.jcabi.com) is based on Java7 JSON API (JSR-353), simplifies tests with a runtime GitHub stub, and **JCabi GitHub API**|[github.jcabi.com (Personal Website)](http://github.jcabi.com)|is based on Java7 JSON API (JSR-353), simplifies tests with a runtime GitHub stub, and covers the entire API.
covers the entire API.
### JavaScript ### JavaScript
* [NodeJS GitHub library][octonode] Library name | Repository |
* [gh3 client-side API v3 wrapper][gh3] |---|---|
* [GitHub.js wrapper around the GitHub API][github] **NodeJS GitHub library**| [pksunkara/octonode](https://github.com/pksunkara/octonode)
* [Promise-Based CoffeeScript library for the browser or NodeJS][github-client] **gh3 client-side API v3 wrapper**| [k33g/gh3](https://github.com/k33g/gh3)
**Github.js wrapper around the GitHub API**|[michael/github](https://github.com/michael/github)
[octonode]: https://github.com/pksunkara/octonode **Promise-Based CoffeeScript library for the Browser or NodeJS**|[philschatz/github-client](https://github.com/philschatz/github-client)
[gh3]: https://github.com/k33g/gh3
[github]: https://github.com/michael/github
[github-client]: https://github.com/philschatz/github-client
### Julia ### Julia
* [GitHub.jl][github.jl] Library name | Repository |
|---|---|
[github.jl]: https://github.com/WestleyArgentum/GitHub.jl **Github.jl**|[WestleyArgentum/Github.jl](https://github.com/WestleyArgentum/GitHub.jl)
### OCaml ### OCaml
* [ocaml-github][ocaml-github] Library name | Repository |
|---|---|
[ocaml-github]: https://github.com/mirage/ocaml-github **ocaml-github**|[mirage/ocaml-github](https://github.com/mirage/ocaml-github)
### Perl ### Perl
* [Pithub][pithub-github] ([CPAN][pithub-cpan]) Library name | Repository | metacpan Website for the Library
* [Net::GitHub][net-github-github] ([CPAN][net-github-cpan]) |---|---|---|
**Pithub**|[plu/Pithub](https://github.com/plu/Pithub)|[Pithub CPAN](http://metacpan.org/module/Pithub)
[net-github-github]: https://github.com/fayland/perl-net-github **Net::Github**|[fayland/perl-net-github](https://github.com/fayland/perl-net-github)|[Net:Github CPAN](https://metacpan.org/pod/Net::GitHub)
[net-github-cpan]: https://metacpan.org/pod/Net::GitHub
[pithub-github]: https://github.com/plu/Pithub
[pithub-cpan]: http://metacpan.org/module/Pithub
### PHP ### PHP
* [GitHub PHP Client][github-php-client] Library name | Repository
* [PHP GitHub API][php-github-api] |---|---|
* [GitHub API][github-api] **GitHub PHP Client**|[tan-tan-kanarek/github-php-client](https://github.com/tan-tan-kanarek/github-php-client)
* [GitHub Joomla! Package][joomla] **PHP GitHub API**|[KnpLabs/php-github-api](https://github.com/KnpLabs/php-github-api)
* [Github Nette Extension][kdyby-github] **GitHub API**|[yiiext/github-api](https://github.com/yiiext/github-api)
* [GitHub API Easy Access][milo-github-api] **GitHub Joomla! Package**|[joomla-framework/github-api](https://github.com/joomla-framework/github-api)
* [GitHub bridge for Laravel][github-laravel] **GitHub Nette Extension**|[kdyby/github](https://github.com/kdyby/github)
* [PHP5.6|PHP7 Client & WebHook wrapper][flexyproject-githubapi] **GitHub API Easy Access**|[milo/github-api](https://github.com/milo/github-api)
**GitHub bridge for Laravel**|[GrahamCampbell/Laravel-Github](https://github.com/GrahamCampbell/Laravel-GitHub)
[github-php-client]: https://github.com/tan-tan-kanarek/github-php-client **PHP7 Client & WebHook wrapper**|[FlexyProject/GithubAPI](https://github.com/FlexyProject/GitHubAPI)
[php-github-api]: https://github.com/KnpLabs/php-github-api
[github-api]: https://github.com/yiiext/github-api
[joomla]: https://github.com/joomla-framework/github-api
[kdyby-github]: https://github.com/kdyby/github
[milo-github-api]: https://github.com/milo/github-api
[github-laravel]: https://github.com/GrahamCampbell/Laravel-GitHub
[flexyproject-githubapi]: https://github.com/FlexyProject/GitHubAPI
### Python ### Python
* [PyGithub][jacquev6_pygithub] Library name | Repository
* [libsaas][libsaas] |---|---|
* [github3.py][github3py] **PyGithub**|[PyGithub/PyGithub](https://github.com/PyGithub/PyGithub)
* [sanction][sanction] **libsaas**|[duckboard/libsaas](https://github.com/ducksboard/libsaas)
* [agithub][agithub] **github3.py**|[sigmavirus24/github3.py](https://github.com/sigmavirus24/github3.py)
* [octohub][octohub] **sanction**|[demianbrecht/sanction](https://github.com/demianbrecht/sanction)
* [Github-Flask][github-flask] **agithub**|[jpaugh/agithub](https://github.com/jpaugh/agithub)
* [torngithub][torngithub] **octohub**|[turnkeylinux/octohub](https://github.com/turnkeylinux/octohub)
**github-flask**|[github-flask (Oficial Website)](http://github-flask.readthedocs.org)
[jacquev6_pygithub]: https://github.com/PyGithub/PyGithub **torngithub**|[jkeylu/torngithub](https://github.com/jkeylu/torngithub)
[libsaas]: https://github.com/ducksboard/libsaas
[github3py]: https://github.com/sigmavirus24/github3.py
[sanction]: https://github.com/demianbrecht/sanction
[agithub]: https://github.com/jpaugh/agithub "Agnostic GitHub"
[octohub]: https://github.com/turnkeylinux/octohub
[github-flask]: http://github-flask.readthedocs.org
[torngithub]: https://github.com/jkeylu/torngithub
### Ruby ### Ruby
* [GitHub API Gem][ghapi] Library name | Repository
* [Ghee][ghee] |---|---|
**GitHub API Gem**|[peter-murach/github](https://github.com/peter-murach/github)
[ghapi]: https://github.com/peter-murach/github **Ghee**|[rauhryan/ghee](https://github.com/rauhryan/ghee)
[ghee]: https://github.com/rauhryan/ghee
### Scala ### Scala
* [Hubcat][hubcat] Library name | Repository
* [Github4s][github4s] |---|---|
**Hubcat**|[softprops/hubcat](https://github.com/softprops/hubcat)
[hubcat]: https://github.com/softprops/hubcat **Github4s**|[47deg/github4s](https://github.com/47deg/github4s)
[Github4s]: https://github.com/47deg/github4s
### Shell ### Shell
* [ok.sh][ok.sh] Library name | Repository
|---|---|
[ok.sh]: https://github.com/whiteinge/ok.sh **ok.sh**|[whiteinge/ok.sh](https://github.com/whiteinge/ok.sh)

View File

@@ -64,7 +64,7 @@ Octicons are icons used across GitHubs interface. We reference Octicons when
`{% octicon "<name of octicon>" %}` `{% octicon "<name of octicon>" %}`
`{% octicon "plus" %}` `{% octicon "plus" %}`
`{% octicon "plus" aria-label="The plus icon"}` `{% octicon "plus" aria-label="The plus icon" %}`
## Operating system tags ## Operating system tags

View File

@@ -66,18 +66,6 @@ upcoming_changes:
date: '2020-10-01T00:00:00+00:00' date: '2020-10-01T00:00:00+00:00'
criticality: breaking criticality: breaking
owner: mikesea owner: mikesea
- location: RepositoryCollaboratorEdge.permission
description: Type for `permission` will change from `RepositoryPermission!` to `String`.
reason: This field may return additional values
date: '2020-10-01T00:00:00+00:00'
criticality: breaking
owner: oneill38
- location: RepositoryInvitation.permission
description: Type for `permission` will change from `RepositoryPermission!` to `String`.
reason: This field may return additional values
date: '2020-10-01T00:00:00+00:00'
criticality: breaking
owner: oneill38
- location: RepositoryInvitationOrderField.INVITEE_LOGIN - location: RepositoryInvitationOrderField.INVITEE_LOGIN
description: "`INVITEE_LOGIN` will be removed." description: "`INVITEE_LOGIN` will be removed."
reason: "`INVITEE_LOGIN` is no longer a valid field value. Repository invitations reason: "`INVITEE_LOGIN` is no longer a valid field value. Repository invitations
@@ -91,12 +79,6 @@ upcoming_changes:
date: '2020-10-01T00:00:00+00:00' date: '2020-10-01T00:00:00+00:00'
criticality: breaking criticality: breaking
owner: nholden owner: nholden
- location: TeamRepositoryEdge.permission
description: Type for `permission` will change from `RepositoryPermission!` to `String`.
reason: This field may return additional values
date: '2020-10-01T00:00:00+00:00'
criticality: breaking
owner: oneill38
- location: EnterpriseMemberEdge.isUnlicensed - location: EnterpriseMemberEdge.isUnlicensed
description: "`isUnlicensed` will be removed." description: "`isUnlicensed` will be removed."
reason: All members consume a license reason: All members consume a license

View File

@@ -1180,6 +1180,16 @@ type Bot implements Actor & Node & UniformResourceLocatable {
A branch protection rule. A branch protection rule.
""" """
type BranchProtectionRule implements Node { type BranchProtectionRule implements Node {
"""
Can this branch be deleted.
"""
allowsDeletions: Boolean!
"""
Are force pushes allowed on this branch.
"""
allowsForcePushes: Boolean!
""" """
A list of conflicts matching branches protection rule and other branch protection rules A list of conflicts matching branches protection rule and other branch protection rules
""" """
@@ -1316,6 +1326,11 @@ type BranchProtectionRule implements Node {
""" """
requiresCommitSignatures: Boolean! requiresCommitSignatures: Boolean!
"""
Are merge commits prohibited from being pushed to this branch.
"""
requiresLinearHistory: Boolean!
""" """
Are status checks required to update matching branches. Are status checks required to update matching branches.
""" """
@@ -27827,10 +27842,6 @@ type RepositoryCollaboratorEdge {
""" """
The permission the user has on the repository. The permission the user has on the repository.
**Upcoming Change on 2020-10-01 UTC**
**Description:** Type for `permission` will change from `RepositoryPermission!` to `String`.
**Reason:** This field may return additional values
""" """
permission: RepositoryPermission! permission: RepositoryPermission!
@@ -28117,10 +28128,6 @@ type RepositoryInvitation implements Node {
""" """
The permission granted on this repository by this invitation. The permission granted on this repository by this invitation.
**Upcoming Change on 2020-10-01 UTC**
**Description:** Type for `permission` will change from `RepositoryPermission!` to `String`.
**Reason:** This field may return additional values
""" """
permission: RepositoryPermission! permission: RepositoryPermission!
@@ -32583,10 +32590,6 @@ type TeamRepositoryEdge {
""" """
The permission level the team has on the repository The permission level the team has on the repository
**Upcoming Change on 2020-10-01 UTC**
**Description:** Type for `permission` will change from `RepositoryPermission!` to `String`.
**Reason:** This field may return additional values
""" """
permission: RepositoryPermission! permission: RepositoryPermission!
} }

View File

@@ -73,18 +73,6 @@ upcoming_changes:
date: '2020-10-01T00:00:00+00:00' date: '2020-10-01T00:00:00+00:00'
criticality: breaking criticality: breaking
owner: mikesea owner: mikesea
- location: RepositoryCollaboratorEdge.permission
description: Type for `permission` will change from `RepositoryPermission!` to `String`.
reason: This field may return additional values
date: '2020-10-01T00:00:00+00:00'
criticality: breaking
owner: oneill38
- location: RepositoryInvitation.permission
description: Type for `permission` will change from `RepositoryPermission!` to `String`.
reason: This field may return additional values
date: '2020-10-01T00:00:00+00:00'
criticality: breaking
owner: oneill38
- location: RepositoryInvitationOrderField.INVITEE_LOGIN - location: RepositoryInvitationOrderField.INVITEE_LOGIN
description: "`INVITEE_LOGIN` will be removed." description: "`INVITEE_LOGIN` will be removed."
reason: "`INVITEE_LOGIN` is no longer a valid field value. Repository invitations reason: "`INVITEE_LOGIN` is no longer a valid field value. Repository invitations
@@ -98,12 +86,6 @@ upcoming_changes:
date: '2020-10-01T00:00:00+00:00' date: '2020-10-01T00:00:00+00:00'
criticality: breaking criticality: breaking
owner: nholden owner: nholden
- location: TeamRepositoryEdge.permission
description: Type for `permission` will change from `RepositoryPermission!` to `String`.
reason: This field may return additional values
date: '2020-10-01T00:00:00+00:00'
criticality: breaking
owner: oneill38
- location: EnterpriseMemberEdge.isUnlicensed - location: EnterpriseMemberEdge.isUnlicensed
description: "`isUnlicensed` will be removed." description: "`isUnlicensed` will be removed."
reason: All members consume a license reason: All members consume a license

View File

@@ -1200,6 +1200,16 @@ type Bot implements Actor & Node & UniformResourceLocatable {
A branch protection rule. A branch protection rule.
""" """
type BranchProtectionRule implements Node { type BranchProtectionRule implements Node {
"""
Can this branch be deleted.
"""
allowsDeletions: Boolean!
"""
Are force pushes allowed on this branch.
"""
allowsForcePushes: Boolean!
""" """
A list of conflicts matching branches protection rule and other branch protection rules A list of conflicts matching branches protection rule and other branch protection rules
""" """
@@ -1336,6 +1346,11 @@ type BranchProtectionRule implements Node {
""" """
requiresCommitSignatures: Boolean! requiresCommitSignatures: Boolean!
"""
Are merge commits prohibited from being pushed to this branch.
"""
requiresLinearHistory: Boolean!
""" """
Are status checks required to update matching branches. Are status checks required to update matching branches.
""" """
@@ -29748,10 +29763,6 @@ type RepositoryCollaboratorEdge {
""" """
The permission the user has on the repository. The permission the user has on the repository.
**Upcoming Change on 2020-10-01 UTC**
**Description:** Type for `permission` will change from `RepositoryPermission!` to `String`.
**Reason:** This field may return additional values
""" """
permission: RepositoryPermission! permission: RepositoryPermission!
@@ -30033,10 +30044,6 @@ type RepositoryInvitation implements Node {
""" """
The permission granted on this repository by this invitation. The permission granted on this repository by this invitation.
**Upcoming Change on 2020-10-01 UTC**
**Description:** Type for `permission` will change from `RepositoryPermission!` to `String`.
**Reason:** This field may return additional values
""" """
permission: RepositoryPermission! permission: RepositoryPermission!
@@ -34897,10 +34904,6 @@ type TeamRepositoryEdge {
""" """
The permission level the team has on the repository The permission level the team has on the repository
**Upcoming Change on 2020-10-01 UTC**
**Description:** Type for `permission` will change from `RepositoryPermission!` to `String`.
**Reason:** This field may return additional values
""" """
permission: RepositoryPermission! permission: RepositoryPermission!
} }

File diff suppressed because one or more lines are too long

View File

@@ -6606,6 +6606,22 @@
} }
], ],
"fields": [ "fields": [
{
"name": "allowsDeletions",
"description": "<p>Can this branch be deleted.</p>",
"type": "Boolean!",
"id": "boolean",
"kind": "scalars",
"href": "/graphql/reference/scalars#boolean"
},
{
"name": "allowsForcePushes",
"description": "<p>Are force pushes allowed on this branch.</p>",
"type": "Boolean!",
"id": "boolean",
"kind": "scalars",
"href": "/graphql/reference/scalars#boolean"
},
{ {
"name": "branchProtectionRuleConflicts", "name": "branchProtectionRuleConflicts",
"description": "<p>A list of conflicts matching branches protection rule and other branch protection rules.</p>", "description": "<p>A list of conflicts matching branches protection rule and other branch protection rules.</p>",
@@ -6854,6 +6870,14 @@
"kind": "scalars", "kind": "scalars",
"href": "/graphql/reference/scalars#boolean" "href": "/graphql/reference/scalars#boolean"
}, },
{
"name": "requiresLinearHistory",
"description": "<p>Are merge commits prohibited from being pushed to this branch.</p>",
"type": "Boolean!",
"id": "boolean",
"kind": "scalars",
"href": "/graphql/reference/scalars#boolean"
},
{ {
"name": "requiresStatusChecks", "name": "requiresStatusChecks",
"description": "<p>Are status checks required to update matching branches.</p>", "description": "<p>Are status checks required to update matching branches.</p>",
@@ -44354,7 +44378,7 @@
}, },
{ {
"name": "permission", "name": "permission",
"description": "<p>The permission the user has on the repository.</p>\n<p><strong>Upcoming Change on 2020-10-01 UTC</strong>\n<strong>Description:</strong> Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.\n<strong>Reason:</strong> This field may return additional values.</p>", "description": "<p>The permission the user has on the repository.</p>",
"type": "RepositoryPermission!", "type": "RepositoryPermission!",
"id": "repositorypermission", "id": "repositorypermission",
"kind": "enums", "kind": "enums",
@@ -44525,7 +44549,7 @@
}, },
{ {
"name": "permission", "name": "permission",
"description": "<p>The permission granted on this repository by this invitation.</p>\n<p><strong>Upcoming Change on 2020-10-01 UTC</strong>\n<strong>Description:</strong> Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.\n<strong>Reason:</strong> This field may return additional values.</p>", "description": "<p>The permission granted on this repository by this invitation.</p>",
"type": "RepositoryPermission!", "type": "RepositoryPermission!",
"id": "repositorypermission", "id": "repositorypermission",
"kind": "enums", "kind": "enums",
@@ -51056,7 +51080,7 @@
}, },
{ {
"name": "permission", "name": "permission",
"description": "<p>The permission level the team has on the repository</p>\n<p><strong>Upcoming Change on 2020-10-01 UTC</strong>\n<strong>Description:</strong> Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.\n<strong>Reason:</strong> This field may return additional values.</p>", "description": "<p>The permission level the team has on the repository.</p>",
"type": "RepositoryPermission!", "type": "RepositoryPermission!",
"id": "repositorypermission", "id": "repositorypermission",
"kind": "enums", "kind": "enums",

View File

@@ -5996,6 +5996,22 @@
} }
], ],
"fields": [ "fields": [
{
"name": "allowsDeletions",
"description": "<p>Can this branch be deleted.</p>",
"type": "Boolean!",
"id": "boolean",
"kind": "scalars",
"href": "/graphql/reference/scalars#boolean"
},
{
"name": "allowsForcePushes",
"description": "<p>Are force pushes allowed on this branch.</p>",
"type": "Boolean!",
"id": "boolean",
"kind": "scalars",
"href": "/graphql/reference/scalars#boolean"
},
{ {
"name": "branchProtectionRuleConflicts", "name": "branchProtectionRuleConflicts",
"description": "<p>A list of conflicts matching branches protection rule and other branch protection rules.</p>", "description": "<p>A list of conflicts matching branches protection rule and other branch protection rules.</p>",
@@ -6244,6 +6260,14 @@
"kind": "scalars", "kind": "scalars",
"href": "/graphql/reference/scalars#boolean" "href": "/graphql/reference/scalars#boolean"
}, },
{
"name": "requiresLinearHistory",
"description": "<p>Are merge commits prohibited from being pushed to this branch.</p>",
"type": "Boolean!",
"id": "boolean",
"kind": "scalars",
"href": "/graphql/reference/scalars#boolean"
},
{ {
"name": "requiresStatusChecks", "name": "requiresStatusChecks",
"description": "<p>Are status checks required to update matching branches.</p>", "description": "<p>Are status checks required to update matching branches.</p>",
@@ -41603,7 +41627,7 @@
}, },
{ {
"name": "permission", "name": "permission",
"description": "<p>The permission the user has on the repository.</p>\n<p><strong>Upcoming Change on 2020-10-01 UTC</strong>\n<strong>Description:</strong> Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.\n<strong>Reason:</strong> This field may return additional values.</p>", "description": "<p>The permission the user has on the repository.</p>",
"type": "RepositoryPermission!", "type": "RepositoryPermission!",
"id": "repositorypermission", "id": "repositorypermission",
"kind": "enums", "kind": "enums",
@@ -41774,7 +41798,7 @@
}, },
{ {
"name": "permission", "name": "permission",
"description": "<p>The permission granted on this repository by this invitation.</p>\n<p><strong>Upcoming Change on 2020-10-01 UTC</strong>\n<strong>Description:</strong> Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.\n<strong>Reason:</strong> This field may return additional values.</p>", "description": "<p>The permission granted on this repository by this invitation.</p>",
"type": "RepositoryPermission!", "type": "RepositoryPermission!",
"id": "repositorypermission", "id": "repositorypermission",
"kind": "enums", "kind": "enums",
@@ -47929,7 +47953,7 @@
}, },
{ {
"name": "permission", "name": "permission",
"description": "<p>The permission level the team has on the repository</p>\n<p><strong>Upcoming Change on 2020-10-01 UTC</strong>\n<strong>Description:</strong> Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.\n<strong>Reason:</strong> This field may return additional values.</p>", "description": "<p>The permission level the team has on the repository.</p>",
"type": "RepositoryPermission!", "type": "RepositoryPermission!",
"id": "repositorypermission", "id": "repositorypermission",
"kind": "enums", "kind": "enums",

View File

@@ -97,22 +97,6 @@
"criticality": "breaking", "criticality": "breaking",
"owner": "mikesea" "owner": "mikesea"
}, },
{
"location": "RepositoryCollaboratorEdge.permission",
"description": "<p>Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.</p>",
"reason": "<p>This field may return additional values</p>",
"date": "2020-10-01",
"criticality": "breaking",
"owner": "oneill38"
},
{
"location": "RepositoryInvitation.permission",
"description": "<p>Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.</p>",
"reason": "<p>This field may return additional values</p>",
"date": "2020-10-01",
"criticality": "breaking",
"owner": "oneill38"
},
{ {
"location": "RepositoryInvitationOrderField.INVITEE_LOGIN", "location": "RepositoryInvitationOrderField.INVITEE_LOGIN",
"description": "<p><code>INVITEE_LOGIN</code> will be removed.</p>", "description": "<p><code>INVITEE_LOGIN</code> will be removed.</p>",
@@ -128,14 +112,6 @@
"date": "2020-10-01", "date": "2020-10-01",
"criticality": "breaking", "criticality": "breaking",
"owner": "nholden" "owner": "nholden"
},
{
"location": "TeamRepositoryEdge.permission",
"description": "<p>Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.</p>",
"reason": "<p>This field may return additional values</p>",
"date": "2020-10-01",
"criticality": "breaking",
"owner": "oneill38"
} }
], ],
"2021-01-01": [ "2021-01-01": [
@@ -1811,22 +1787,6 @@
"criticality": "breaking", "criticality": "breaking",
"owner": "mikesea" "owner": "mikesea"
}, },
{
"location": "RepositoryCollaboratorEdge.permission",
"description": "<p>Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.</p>",
"reason": "<p>This field may return additional values</p>",
"date": "2020-10-01",
"criticality": "breaking",
"owner": "oneill38"
},
{
"location": "RepositoryInvitation.permission",
"description": "<p>Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.</p>",
"reason": "<p>This field may return additional values</p>",
"date": "2020-10-01",
"criticality": "breaking",
"owner": "oneill38"
},
{ {
"location": "RepositoryInvitationOrderField.INVITEE_LOGIN", "location": "RepositoryInvitationOrderField.INVITEE_LOGIN",
"description": "<p><code>INVITEE_LOGIN</code> will be removed.</p>", "description": "<p><code>INVITEE_LOGIN</code> will be removed.</p>",
@@ -1842,14 +1802,6 @@
"date": "2020-10-01", "date": "2020-10-01",
"criticality": "breaking", "criticality": "breaking",
"owner": "nholden" "owner": "nholden"
},
{
"location": "TeamRepositoryEdge.permission",
"description": "<p>Type for <code>permission</code> will change from <code>RepositoryPermission!</code> to <code>String</code>.</p>",
"reason": "<p>This field may return additional values</p>",
"date": "2020-10-01",
"criticality": "breaking",
"owner": "oneill38"
} }
], ],
"2021-01-01": [ "2021-01-01": [

View File

@@ -1,9 +0,0 @@
// This middleware serves an endpoint that's used by https://github.com/docs/scheduled-tasks
module.exports = async (req, res, next) => {
if (req.path !== '/enterprise.json') return next()
return res.json({
enterpriseDates: require('../lib/enterprise-dates'),
enterpriseVersions: require('../lib/enterprise-server-releases')
})
}

View File

@@ -11,10 +11,17 @@ const router = express.Router()
router.post('/', async (req, res, next) => { router.post('/', async (req, res, next) => {
const fields = omit(req.body, '_csrf') const fields = omit(req.body, '_csrf')
if (!ajv.validate(schema, fields)) { if (!ajv.validate(schema, fields)) {
if (process.env.NODE_ENV === 'development') console.log(ajv.errorsText()) if (process.env.NODE_ENV === 'development') console.log(ajv.errorsText())
return res.status(400).json({}) return res.status(400).json({})
} }
// Don't depend on Hydro on local development
if (process.env.NODE_ENV === 'development' && !req.hydro.maySend()) {
return res.status(200).json({})
}
try { try {
const hydroRes = await req.hydro.publish( const hydroRes = await req.hydro.publish(
req.hydro.schemas[fields.type], req.hydro.schemas[fields.type],

View File

@@ -36,7 +36,6 @@ module.exports = function (app) {
app.use('/dist', express.static('dist')) app.use('/dist', express.static('dist'))
app.use('/events', require('./events')) app.use('/events', require('./events'))
app.use(require('./categories-for-support-team')) app.use(require('./categories-for-support-team'))
app.use(require('./enterprise-data-endpoint'))
app.use(require('./detect-language')) app.use(require('./detect-language'))
app.use(asyncMiddleware(require('./context'))) app.use(asyncMiddleware(require('./context')))
app.use('/csrf', require('./csrf-route')) app.use('/csrf', require('./csrf-route'))

8
package-lock.json generated
View File

@@ -1156,9 +1156,9 @@
} }
}, },
"@github/rest-api-operations": { "@github/rest-api-operations": {
"version": "3.3.2", "version": "3.6.1",
"resolved": "https://registry.npmjs.org/@github/rest-api-operations/-/rest-api-operations-3.3.2.tgz", "resolved": "https://registry.npmjs.org/@github/rest-api-operations/-/rest-api-operations-3.6.1.tgz",
"integrity": "sha512-0AYobx/iwl1RKrjOi/c/g+kB7u8WlgzBu9lpU1QnoXJJyi/NoBSxF4bAGJyPeG3hm+3izL3U7dpVOtq04X66rw==" "integrity": "sha512-tMbNFpAIxwalH46AIZGLM+6s1bP4B65lIaRZcDOrqpHbsDDRhO4fGklxqk2CfPz8goRRBETppKqOnhSmEPnADQ=="
}, },
"@hapi/address": { "@hapi/address": {
"version": "2.1.4", "version": "2.1.4",
@@ -7297,7 +7297,7 @@
}, },
"load-json-file": { "load-json-file": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
"integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
"dev": true, "dev": true,
"requires": { "requires": {

View File

@@ -16,7 +16,7 @@
"@github-docs/data-directory": "^1.2.0", "@github-docs/data-directory": "^1.2.0",
"@github-docs/frontmatter": "^1.3.1", "@github-docs/frontmatter": "^1.3.1",
"@github-docs/render-content": "^5.2.0", "@github-docs/render-content": "^5.2.0",
"@github/rest-api-operations": "^3.3.2", "@github/rest-api-operations": "^3.6.1",
"@octokit/rest": "^16.38.1", "@octokit/rest": "^16.38.1",
"@primer/css": "^15.1.0", "@primer/css": "^15.1.0",
"@primer/octicons": "^11.0.0", "@primer/octicons": "^11.0.0",

View File

@@ -15,6 +15,20 @@ const processUpcomingChanges = require('./utils/process-upcoming-changes')
const processSchemas = require('./utils/process-schemas') const processSchemas = require('./utils/process-schemas')
const prerenderObjects = require('./utils/prerender-objects') const prerenderObjects = require('./utils/prerender-objects')
// check for required PAT
if (!process.env.GITHUB_TOKEN) {
console.error('Error! You must have a GITHUB_TOKEN set in an .env file to run this script.')
process.exit(1)
}
// check for required Ruby gems (see note below about why this is needed)
try {
execSync('gem which graphql')
} catch (err) {
console.error('\nYou need to run: bundle install')
process.exit(1)
}
// TODO this step is only required as long as we support GHE versions *OLDER THAN* 2.21 // TODO this step is only required as long as we support GHE versions *OLDER THAN* 2.21
// as soon as 2.20 is deprecated on 2021-02-11, we can remove all graphql-ruby filtering // as soon as 2.20 is deprecated on 2021-02-11, we can remove all graphql-ruby filtering
const removeHiddenMembersScript = path.join(__dirname, './utils/remove-hidden-schema-members.rb') const removeHiddenMembersScript = path.join(__dirname, './utils/remove-hidden-schema-members.rb')

View File

@@ -163,24 +163,6 @@ describe('server', () => {
}) })
}) })
test('serves publicly accessible /enterprise.json', async () => {
const res = await get('/enterprise.json')
// check for CORS header
expect(res.headers['access-control-allow-origin']).toBe('*')
const enterpriseData = JSON.parse(res.text)
expect(Object.keys(enterpriseData).length).toBe(2)
expect(enterpriseData.enterpriseDates['2.0'].releaseDate).toBe('2014-11-11')
expect(enterpriseData.enterpriseDates['2.15'].deprecationDate).toBe('2019-10-16')
expect(enterpriseData.enterpriseVersions.supported.length).toBeGreaterThan(2)
expect(enterpriseData.enterpriseVersions.deprecated.length).toBeGreaterThan(16)
expect(typeof enterpriseData.enterpriseVersions.latest).toBe('string')
expect(typeof enterpriseData.enterpriseVersions.oldestSupported).toBe('string')
expect(typeof enterpriseData.enterpriseVersions.nextDeprecationDate).toBe('string')
expect(enterpriseData.enterpriseVersions.deprecatedOnNewSite.length).toBeGreaterThan(2)
})
test('renders Markdown links that have Liquid hrefs', async () => { test('renders Markdown links that have Liquid hrefs', async () => {
// example from markdown source: // example from markdown source:
// 1. Go to {{ site.data.variables.product.product_name }}'s [Pricing]({{ site.data.variables.dotcom_billing.plans_url }}) page. // 1. Go to {{ site.data.variables.product.product_name }}'s [Pricing]({{ site.data.variables.dotcom_billing.plans_url }}) page.