Skip to content

Commit dc84df9

Browse files
authored
Merge pull request github#7566 from github/repo-sync
repo sync
2 parents e3b2313 + c884cf0 commit dc84df9

File tree

9 files changed

+44
-29
lines changed

9 files changed

+44
-29
lines changed

content/actions/reference/authentication-in-a-workflow.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ jobs:
7979
issues: write {% endif %}
8080
steps:
8181
- name: Create issue using REST API
82-
run: {% raw %}|
82+
run: |
8383
curl --request POST \
84-
--url https://api.github.com/repos/${{ github.repository }}/issues \
85-
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
84+
--url {% data variables.product.api_url_code %}/repos/${% raw %}{{ github.repository }}{% endraw %}/issues \
85+
--header 'authorization: Bearer ${% raw %}{{ secrets.GITHUB_TOKEN }}{% endraw %}' \
8686
--header 'content-type: application/json' \
8787
--data '{
88-
"title": "Automated issue for commit: ${{ github.sha }}",
89-
"body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_."
88+
"title": "Automated issue for commit: ${% raw %}{{ github.sha }}{% endraw %}",
89+
"body": "This issue was automatically created by the GitHub Action workflow **${% raw %}{{ github.workflow }}{% endraw %}**. \n\n The commit hash was: _${% raw %}{{ github.sha }}{% endraw %}_."
9090
}' \
91-
--fail{% endraw %}
91+
--fail
9292
```
9393

9494
## Permissions for the `GITHUB_TOKEN`

content/admin/authentication/managing-identity-and-access-for-your-enterprise/configuring-user-provisioning-for-your-enterprise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ You must have administrative access on your IdP to configure the application for
8484

8585
| Value | Other names | Description | Example |
8686
| :- | :- | :- | :- |
87-
| URL | Tenant URL | URL to the SCIM provisioning API for your enterprise on {% data variables.product.prodname_ghe_managed %} | <pre>https&colon;//api.<em>YOUR-GITHUB-AE-HOSTNAME</em>/scim/v2</pre> |
87+
| URL | Tenant URL | URL to the SCIM provisioning API for your enterprise on {% data variables.product.prodname_ghe_managed %} | <nobr><code>{% data variables.product.api_url_pre %}</nobr></code> |
8888
| Shared secret | Personal access token, secret token | Token for application on your IdP to perform provisioning tasks on behalf of an enterprise owner | Personal access token you created in step 1 |
8989

9090
{% endif %}

content/developers/apps/getting-started-with-apps/setting-up-your-development-environment-to-create-a-github-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ Here are a few common problems and some suggested solutions. If you run into any
426426
427427
* **Q:** I'm getting an `Octokit::NotFound` 404 error in my debug output:
428428
```
429-
2018-12-06 15:00:56 - Octokit::NotFound - POST https://api.github.com/app/installations/500991/access_tokens: 404 - Not Found // See: /v3/apps/#create-a-new-installation-token:
429+
2018-12-06 15:00:56 - Octokit::NotFound - POST {% data variables.product.api_url_code %}/app/installations/500991/access_tokens: 404 - Not Found // See: /v3/apps/#create-a-new-installation-token:
430430
```
431431

432432
**A:** Ensure the variables in your `.env` file are correct. Make sure that you have not set identical variables in any other environment variable files like `bash_profile`. You can check the environment variables your app is using by adding `puts` statements to your app code and re-running the code. For example, to ensure you have the correct private key set, you could add `puts PRIVATE_KEY` to your app code:

content/developers/apps/guides/using-content-attachments.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ The content attachment flow shows you the relationship between the URL in the is
6666

6767
The `body` parameter can contain markdown:
6868

69-
```shell
70-
curl -X POST \
71-
https://api.github.com/repos/Codertocat/Hello-World/content_references/17/attachments \
72-
-H 'Accept: application/vnd.github.corsair-preview+json' \
73-
-H 'Authorization: Bearer $INSTALLATION_TOKEN' \
74-
-d '{
75-
"title": "[A-1234] Error found in core/models.py file",
76-
"body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()"
77-
}'
78-
```
69+
```shell
70+
curl -X POST \
71+
{% data variables.product.api_url_code %}/repos/Codertocat/Hello-World/content_references/17/attachments \
72+
-H 'Accept: application/vnd.github.corsair-preview+json' \
73+
-H 'Authorization: Bearer $INSTALLATION_TOKEN' \
74+
-d '{
75+
"title": "[A-1234] Error found in core/models.py file",
76+
"body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()"
77+
}'
78+
```
7979

8080
For more information about creating an installation token, see "[Authenticating as a GitHub App](/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation)."
8181

@@ -111,7 +111,7 @@ mutation {
111111
Example cURL:
112112

113113
```shell
114-
curl -X "POST" "https://api.github.com/graphql" \
114+
curl -X "POST" "{% data variables.product.api_url_code %}/graphql" \
115115
-H 'Authorization: Bearer $INSTALLATION_TOKEN' \
116116
-H 'Accept: application/vnd.github.corsair-preview+json' \
117117
-H 'Content-Type: application/json; charset=utf-8' \

content/rest/guides/getting-started-with-the-rest-api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ topics:
1313
---
1414

1515

16-
Let's walk through core API concepts as we tackle some everyday use cases.
16+
Let's walk through core API concepts as we tackle some everyday use cases.
17+
18+
{% data reusables.rest-api.dotcom-only-guide-note %}
1719

1820
## Overview
1921

content/rest/guides/traversing-with-pagination.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ topics:
1212
- API
1313
---
1414

15-
16-
1715
The {% data variables.product.product_name %} API provides a vast wealth of information for developers to consume.
1816
Most of the time, you might even find that you're asking for _too much_ information,
1917
and in order to keep our servers happy, the API will automatically [paginate the requested items][pagination].
2018

21-
In this guide, we'll make some calls to the {% data variables.product.product_name %} Search API, and iterate over
19+
In this guide, we'll make some calls to the Search API, and iterate over
2220
the results using pagination. You can find the complete source code for this project
2321
in the [platform-samples][platform samples] repository.
2422

23+
{% data reusables.rest-api.dotcom-only-guide-note %}
24+
2525
## Basics of Pagination
2626

2727
To start with, it's important to know a few facts about receiving paginated items:
@@ -40,7 +40,7 @@ of an API call. For example, let's make a curl request to the search API, to fin
4040
out how many times Mozilla projects use the phrase `addClass`:
4141

4242
```shell
43-
$ curl -I "{% data variables.product.api_url_pre %}/search/code?q=addClass+user:mozilla"
43+
$ curl -I "https://api.github.com/search/code?q=addClass+user:mozilla"
4444
```
4545

4646
The `-I` parameter indicates that we only care about the headers, not the actual
@@ -66,7 +66,7 @@ parameter. By default, `page` always starts at `1`. Let's jump ahead to page 14
6666
and see what happens:
6767

6868
```shell
69-
$ curl -I "{% data variables.product.api_url_pre %}/search/code?q=addClass+user:mozilla&page=14"
69+
$ curl -I "https://api.github.com/search/code?q=addClass+user:mozilla&page=14"
7070
```
7171

7272
Here's the link header once more:
@@ -88,7 +88,7 @@ By passing the `per_page` parameter, you can specify how many items you want
8888
each page to return, up to 100 items. Let's try asking for 50 items about `addClass`:
8989

9090
```shell
91-
$ curl -I "{% data variables.product.api_url_pre %}/search/code?q=addClass+user:mozilla&per_page=50"
91+
$ curl -I "https://api.github.com/search/code?q=addClass+user:mozilla&per_page=50"
9292
```
9393

9494
Notice what it does to the header response:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1. Under "{% data variables.product.prodname_dotcom %} API URL", type {% if currentVersion == "free-pro-team@latest" %}https://api.github.com {% else %}the URL you use to access {% data variables.product.prodname_enterprise %}{% endif %}.
1+
1. Under "{% data variables.product.prodname_dotcom %} API URL", type {% if currentVersion == "free-pro-team@latest" %}https://api.github.com{% else %}the URL you use to access {% data variables.product.product_name %}{% endif %}.
22
![{% data variables.product.prodname_enterprise %} API URL field](/assets/images/help/insights/enterprise-api-url.png)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% if currentVersion != "free-pro-team@latest" %}
2+
3+
{% note %}
4+
5+
**Note**: The following guide uses the REST API for {% data variables.product.prodname_dotcom_the_website %}.
6+
7+
- Use <code>{% data variables.product.api_url_pre %}</code> to access the API for {% data variables.product.product_name %}.
8+
9+
- The guide specifies usernames and repositories that may not exist on {% data variables.product.product_location %}. You may need to use different names to see similar output.
10+
11+
{% endnote %}
12+
13+
{% endif %}

data/variables/product.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ doc_url_pre: >-
188188
{% if currentVersion == "free-pro-team@latest" %}https://docs.github.com/rest{% elsif enterpriseServerVersions contains currentVersion %}https://docs.github.com/enterprise/{{ currentVersion | version_num }}/rest{% elsif currentVersion == "github-ae@latest" %}https://docs.github.com/github-ae@latest/rest{% endif %}
189189
# Use this inside command-line code blocks
190190
api_url_pre: >-
191-
{% if currentVersion == "free-pro-team@latest" %}https://api.github.com{% elsif enterpriseServerVersions contains currentVersion %}http(s)://<em>[hostname]</em>/api/v3{% elsif currentVersion == "github-ae@latest" %}https://api.<em>[hostname]</em>{% endif %}
191+
{% if currentVersion == "free-pro-team@latest" %}https://api.github.com{% elsif enterpriseServerVersions contains currentVersion %}http(s)://<em>[hostname]</em>/api/v3{% elsif currentVersion == "github-ae@latest" %}https://<em>[hostname]</em>/api/v3{% endif %}
192192
# Use this inside command-line code blocks
193193
# Enterprise OAuth paths that don't include "/graphql" or "/api/v3"
194194
oauth_host_code: >-
@@ -197,7 +197,7 @@ device_authorization_url: >-
197197
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" or currentVersion == "github-ae@latest" %}[`https://github.com/login/device`](https://github.com/login/device){% else %}`http(s)://[hostname]/login/device`{% endif %}
198198
# Use this all other code blocks
199199
api_url_code: >-
200-
{% if currentVersion == "free-pro-team@latest" %}https://api.github.com{% elsif enterpriseServerVersions contains currentVersion %}http(s)://[hostname]/api/v3{% elsif currentVersion == "github-ae@latest" %}https://api.[hostname]{% endif %}
200+
{% if currentVersion == "free-pro-team@latest" %}https://api.github.com{% elsif enterpriseServerVersions contains currentVersion %}http(s)://[hostname]/api/v3{% elsif currentVersion == "github-ae@latest" %}https://[hostname]/api/v3{% endif %}
201201
# Use this inside command-line code blocks
202202
graphql_url_pre: >-
203203
{% if currentVersion == "free-pro-team@latest" %}https://api.github.com/graphql{% elsif enterpriseServerVersions contains currentVersion %}http(s)://<em>[hostname]</em>/api/graphql{% elsif currentVersion == "github-ae@latest" %}https://api.<em>[hostname]</em>/graphql{% endif %}

0 commit comments

Comments
 (0)