You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/actions/learn-github-actions/variables.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -278,12 +278,12 @@ We strongly recommend that actions use variables to access the filesystem rather
278
278
{%- ifversion actions-oidc-custom-claims %}
279
279
| `GITHUB_ACTOR_ID` | {% data reusables.actions.actor_id-description %} |
280
280
{%- endif %}
281
-
| `GITHUB_API_URL` | Returns the API URL. For example: `{% data variables.product.api_url_code %}`.
281
+
| `GITHUB_API_URL` | Returns the API URL. For example: `{% data variables.product.rest_url %}`.
282
282
| `GITHUB_BASE_REF` | The name of the base ref or target branch of the pull request in a workflow run. This is only set when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. For example, `main`. |
283
283
| `GITHUB_ENV` | The path on the runner to the file that sets variables from workflow commands. The path to this file is unique to the current step and changes for each step in a job. For example, `/home/runner/work/_temp/_runner_file_commands/set_env_87406d6e-4979-4d42-98e1-3dab1f48b13a`. For more information, see "[AUTOTITLE](/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable)." |
284
284
| `GITHUB_EVENT_NAME` | The name of the event that triggered the workflow. For example, `workflow_dispatch`. |
285
285
| `GITHUB_EVENT_PATH` | The path to the file on the runner that contains the full event webhook payload. For example, `/github/workflow/event.json`. |
286
-
| `GITHUB_GRAPHQL_URL` | Returns the GraphQL API URL. For example: `{% data variables.product.graphql_url_code %}`.
286
+
| `GITHUB_GRAPHQL_URL` | Returns the GraphQL API URL. For example: `{% data variables.product.graphql_url %}`.
287
287
| `GITHUB_HEAD_REF` | The head ref or source branch of the pull request in a workflow run. This property is only set when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. For example, `feature-branch-1`. |
288
288
| `GITHUB_JOB` | The [job_id](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id) of the current job. For example, `greeting_job`. |
289
289
| `GITHUB_OUTPUT` | The path on the runner to the file that sets the current step's outputs from workflow commands. The path to this file is unique to the current step and changes for each step in a job. For example, `/home/runner/work/_temp/_runner_file_commands/set_output_a50ef383-b063-46d9-9157-57953fc9f3f0`. For more information, see "[AUTOTITLE](/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter)." |
Copy file name to clipboardExpand all lines: content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/using-the-audit-log-api-for-your-enterprise.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ The query below searches for audit log events created on Jan 1st, 2022 in the `a
49
49
```shell
50
50
curl -H "Authorization: Bearer TOKEN" \
51
51
--request GET \
52
-
"{% data variables.product.api_url_code %}/enterprises/avocado-corp/audit-log?phrase=created:2022-01-01&page=1&per_page=100"
52
+
"{% data variables.product.rest_url %}/enterprises/avocado-corp/audit-log?phrase=created:2022-01-01&page=1&per_page=100"
53
53
```
54
54
55
55
{% else %}
@@ -59,23 +59,23 @@ The query below searches for audit log events created on Jan 1st, 2022 in the `a
59
59
```shell
60
60
curl --include -H "Authorization: Bearer TOKEN" \
61
61
--request GET \
62
-
"{% data variables.product.api_url_code %}/enterprises/avocado-corp/audit-log?phrase=created:2022-01-01&per_page=100"
62
+
"{% data variables.product.rest_url %}/enterprises/avocado-corp/audit-log?phrase=created:2022-01-01&per_page=100"
63
63
```
64
64
65
65
If there are more than 100 results, the `link` header will include URLs to fetch the next, first, and previous pages of results.
66
66
67
67
```text
68
-
link: <{% data variables.product.api_url_code %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=MS42NjQzODMzNTk5MjdlKzEyfDloQzBxdURzaFdVbVlLWjkxRU9mNXc%3D&before=>; rel="next",
69
-
<{% data variables.product.api_url_code %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=&before=>; rel="first",
70
-
<{% data variables.product.api_url_code %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=&before=MS42Njc4NDA2MjM4MzNlKzEyfExqeG5sUElvNEZMbG1XZHA5akdKTVE%3D>; rel="prev"
68
+
link: <{% data variables.product.rest_url %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=MS42NjQzODMzNTk5MjdlKzEyfDloQzBxdURzaFdVbVlLWjkxRU9mNXc%3D&before=>; rel="next",
69
+
<{% data variables.product.rest_url %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=&before=>; rel="first",
70
+
<{% data variables.product.rest_url %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=&before=MS42Njc4NDA2MjM4MzNlKzEyfExqeG5sUElvNEZMbG1XZHA5akdKTVE%3D>; rel="prev"
71
71
```
72
72
73
73
Copy the corresponding pagination link into your next request. For example:
74
74
75
75
```shell
76
76
curl -I -H "Authorization: Bearer TOKEN" \
77
77
--request GET \
78
-
"{% data variables.product.api_url_code %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=MS42Njc4NDA2MjM5NDFlKzEyfHRYa3AwSkxUd2xyRjA5bWxfOS1RbFE%3D&before="
78
+
"{% data variables.product.rest_url %}/enterprises/13827/audit-log?%3A2022-11-01=&per_page=100&after=MS42Njc4NDA2MjM5NDFlKzEyfHRYa3AwSkxUd2xyRjA5bWxfOS1RbFE%3D&before="
79
79
```
80
80
81
81
{% endif %}
@@ -89,7 +89,7 @@ The query below searches for audit log events for pull requests, where the event
89
89
```shell
90
90
curl -H "Authorization: Bearer TOKEN" \
91
91
--request GET \
92
-
"{% data variables.product.api_url_code %}/enterprises/avocado-corp/audit-log?phrase=action:pull_request+created:>=2022-01-01+actor:octocat"
92
+
"{% data variables.product.rest_url %}/enterprises/avocado-corp/audit-log?phrase=action:pull_request+created:>=2022-01-01+actor:octocat"
93
93
```
94
94
95
95
## Example 3: Events for Git activity in an enterprise, for a specific date and actor
@@ -101,5 +101,5 @@ The query below searches for audit log events for Git activity, where the event
101
101
```shell
102
102
curl -H "Authorization: Bearer TOKEN" \
103
103
--request GET \
104
-
"{% data variables.product.api_url_code %}/enterprises/avocado-corp/audit-log?phrase=created:>=2024-01-01+actor:octocat&include=git"
104
+
"{% data variables.product.rest_url %}/enterprises/avocado-corp/audit-log?phrase=created:>=2024-01-01+actor:octocat&include=git"
Copy file name to clipboardExpand all lines: content/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ In the following example, replace `INSTALLATION_ACCESS_TOKEN` with an installati
46
46
47
47
```shell
48
48
curl --request GET \
49
-
--url "{% data variables.product.api_url_pre %}/meta" \
49
+
--url "{% data variables.product.rest_url %}/meta" \
Copy file name to clipboardExpand all lines: content/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ To use a JWT, pass it in the `Authorization` header of an API request. For examp
27
27
28
28
```shell
29
29
curl --request GET \
30
-
--url "{% data variables.product.api_url_pre %}/app" \
30
+
--url "{% data variables.product.rest_url %}/app" \
Copy file name to clipboardExpand all lines: content/apps/creating-github-apps/writing-code-for-a-github-app/building-a-login-with-github-button-with-a-github-app.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,7 @@ These steps lead you through writing code to generate a user access token. To sk
249
249
250
250
```ruby copy
251
251
defuser_info(token)
252
-
uri =URI("{% data variables.product.api_url_code %}/user")
252
+
uri =URI("{% data variables.product.rest_url %}/user")
253
253
254
254
result =Net::HTTP.start(uri.host, uri.port, use_ssl:true) do |http|
255
255
body = {"access_token" => token}.to_json
@@ -332,7 +332,7 @@ def exchange_code(code)
332
332
end
333
333
334
334
defuser_info(token)
335
-
uri =URI("{% data variables.product.api_url_code %}/user")
335
+
uri =URI("{% data variables.product.rest_url %}/user")
336
336
337
337
result =Net::HTTP.start(uri.host, uri.port, use_ssl:true) do |http|
Copy file name to clipboardExpand all lines: content/codespaces/developing-in-a-codespace/default-environment-variables-for-your-codespace.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,8 @@ redirect_from:
33
33
|`GIT_COMMITTER_EMAIL`| The email for the "author" field of future `git` commits. |
34
34
|`GIT_COMMITTER_NAME`| The name for the "committer" field of future `git` commits. |
35
35
|`GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN`| Returns the domain of the {% data variables.product.prodname_github_codespaces %} forwarded port. For example, `app.github.dev`. |
36
-
|`GITHUB_API_URL`| Returns the API URL. For example, `{% data variables.product.api_url_code %}`. |
37
-
|`GITHUB_GRAPHQL_URL`| Returns the GraphQL API URL. For example, `{% data variables.product.graphql_url_code %}`. |
36
+
|`GITHUB_API_URL`| Returns the API URL. For example, `{% data variables.product.rest_url %}`. |
37
+
|`GITHUB_GRAPHQL_URL`| Returns the GraphQL API URL. For example, `{% data variables.product.graphql_url %}`. |
38
38
|`GITHUB_REPOSITORY`| The owner and repository name. For example, `octocat/Hello-World`. |
39
39
|`GITHUB_SERVER_URL`| Returns the URL of the {% data variables.product.product_name %} server. For example, `https://{% data variables.product.product_url %}`. |
40
40
|`GITHUB_TOKEN`| A signed auth token representing the user in the codespace. You can use this to make authenticated calls to the GitHub API. For more information, see "[AUTOTITLE](/codespaces/reference/security-in-github-codespaces#authentication)." |
Copy file name to clipboardExpand all lines: content/graphql/guides/migrating-from-rest-to-graphql.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Here are examples of each.
39
39
A single REST API call retrieves a list of your organization's members:
40
40
41
41
```shell
42
-
curl -v {% data variables.product.api_url_pre %}/orgs/:org/members
42
+
curl -v {% data variables.product.rest_url %}/orgs/:org/members
43
43
```
44
44
45
45
The REST payload contains excessive data if your goal is to retrieve only member names and links to avatars. However, a GraphQL query returns only what you specify:
@@ -62,13 +62,13 @@ query {
62
62
Consider another example: retrieving a list of pull requests and checking if each one is mergeable. A call to the REST API retrieves a list of pull requests and their [summary representations](/rest#summary-representations):
63
63
64
64
```shell
65
-
curl -v {% data variables.product.api_url_pre %}/repos/:owner/:repo/pulls
65
+
curl -v {% data variables.product.rest_url %}/repos/:owner/:repo/pulls
66
66
```
67
67
68
68
Determining if a pull request is mergeable requires retrieving each pull request individually for its [detailed representation](/rest#detailed-representations) (a large payload) and checking whether its `mergeable` attribute is true or false:
69
69
70
70
```shell
71
-
curl -v {% data variables.product.api_url_pre %}/repos/:owner/:repo/pulls/:number
71
+
curl -v {% data variables.product.rest_url %}/repos/:owner/:repo/pulls/:number
72
72
```
73
73
74
74
With GraphQL, you could retrieve only the `number` and `mergeable` attributes for each pull request:
@@ -93,10 +93,10 @@ query {
93
93
Querying with nested fields lets you replace multiple REST calls with fewer GraphQL queries. For example, retrieving a pull request along with its commits, non-review comments, and reviews using the **REST API** requires four separate calls:
94
94
95
95
```shell
96
-
curl -v {% data variables.product.api_url_pre %}/repos/:owner/:repo/pulls/:number
97
-
curl -v {% data variables.product.api_url_pre %}/repos/:owner/:repo/pulls/:number/commits
98
-
curl -v {% data variables.product.api_url_pre %}/repos/:owner/:repo/issues/:number/comments
99
-
curl -v {% data variables.product.api_url_pre %}/repos/:owner/:repo/pulls/:number/reviews
96
+
curl -v {% data variables.product.rest_url %}/repos/:owner/:repo/pulls/:number
97
+
curl -v {% data variables.product.rest_url %}/repos/:owner/:repo/pulls/:number/commits
98
+
curl -v {% data variables.product.rest_url %}/repos/:owner/:repo/issues/:number/comments
99
+
curl -v {% data variables.product.rest_url %}/repos/:owner/:repo/pulls/:number/reviews
100
100
```
101
101
102
102
Using the **GraphQL API**, you can retrieve the data with a single query using nested fields:
0 commit comments