Merge pull request #39152 from github/repo-sync · github/docs@33e6ee4 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 33e6ee4

Browse files
authored
Merge pull request #39152 from github/repo-sync
Repo sync
2 parents 6f1c3a9 + 63679c4 commit 33e6ee4

File tree

34 files changed

+1270
-861
lines changed

34 files changed

+1270
-861
lines changed

content/actions/concepts/workflows-and-actions/about-custom-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Many people access {% data variables.product.github %} at a domain other than {%
8383

8484
To ensure that your action is compatible with other platforms, do not use any hard-coded references to API URLs such as `https://api.github.com`. Instead, you can:
8585

86-
* Use environment variables (see [AUTOTITLE](/actions/learn-github-actions/variables#default-environment-variables)):
86+
* Use environment variables (see [AUTOTITLE](/actions/reference/variables-reference#default-environment-variables)):
8787

8888
* For the REST API, use the `GITHUB_API_URL` environment variable.
8989
* For GraphQL, use the `GITHUB_GRAPHQL_URL` environment variable.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Contexts
3+
shortTitle: Contexts
4+
intro: 'Learn about contexts in {% data variables.product.prodname_actions %}.'
5+
versions:
6+
fpt: '*'
7+
ghes: '*'
8+
ghec: '*'
9+
type: overview
10+
topics:
11+
- Actions
12+
- Workflows
13+
---
14+
15+
## About contexts
16+
17+
{% data reusables.actions.actions-contexts-about-description %} Each context is an object that contains properties, which can be strings or other objects.
18+
19+
{% data reusables.actions.context-contents %} For example, the `matrix` context is only populated for jobs in a [matrix](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix).
20+
21+
You can access contexts using the expression syntax. For more information, see [AUTOTITLE](/actions/learn-github-actions/expressions).
22+
23+
{% raw %}
24+
`${{ <context> }}`
25+
{% endraw %}
26+
27+
{% data reusables.actions.context-injection-warning %}
28+
29+
## Determining when to use contexts
30+
31+
{% data variables.product.prodname_actions %} includes a collection of variables called _contexts_ and a similar collection of variables called _default variables_. These variables are intended for use at different points in the workflow:
32+
33+
* **Default environment variables:** These environment variables exist only on the runner that is executing your job. For more information, see [AUTOTITLE](/actions/learn-github-actions/variables#default-environment-variables).
34+
* **Contexts:** You can use most contexts at any point in your workflow, including when _default variables_ would be unavailable. For example, you can use contexts with expressions to perform initial processing before the job is routed to a runner for execution; this allows you to use a context with the conditional `if` keyword to determine whether a step should run. Once the job is running, you can also retrieve context variables from the runner that is executing the job, such as `runner.os`. For details of where you can use various contexts within a workflow, see [AUTOTITLE](/actions/reference/accessing-contextual-information-about-workflow-runs#context-availability).
35+
36+
The following example demonstrates how these different types of variables can be used together in a job:
37+
38+
{% raw %}
39+
40+
```yaml copy
41+
name: CI
42+
on: push
43+
jobs:
44+
prod-check:
45+
if: ${{ github.ref == 'refs/heads/main' }}
46+
runs-on: ubuntu-latest
47+
steps:
48+
- run: echo "Deploying to production server on branch $GITHUB_REF"
49+
```
50+
51+
{% endraw %}
52+
53+
In this example, the `if` statement checks the [`github.ref`](/actions/learn-github-actions/contexts#github-context) context to determine the current branch name; if the name is `refs/heads/main`, then the subsequent steps are executed. The `if` check is processed by {% data variables.product.prodname_actions %}, and the job is only sent to the runner if the result is `true`. Once the job is sent to the runner, the step is executed and refers to the [`$GITHUB_REF`](/actions/learn-github-actions/variables#default-environment-variables) variable from the runner.

content/actions/concepts/workflows-and-actions/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ versions:
77
ghec: '*'
88
children:
99
- /about-workflows
10+
- /variables
1011
- /avoiding-duplication
1112
- /about-custom-actions
13+
- /contexts
1214
- /about-monitoring-workflows
1315
- /notifications-for-workflow-runs
1416
- /about-troubleshooting-workflows
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Variables
3+
intro: 'Learn about variables in {% data variables.product.prodname_actions %} workflows.'
4+
versions:
5+
fpt: '*'
6+
ghes: '*'
7+
ghec: '*'
8+
type: overview
9+
topics:
10+
- Action development
11+
- Fundamentals
12+
---
13+
14+
## About
15+
16+
Variables provide a way to store and reuse non-sensitive configuration information. You can store any configuration data such as compiler flags, usernames, or server names as variables. Variables are interpolated on the runner machine that runs your workflow. Commands that run in actions or workflow steps can create, read, and modify variables.
17+
18+
You can set your own custom variables or use the default environment variables that {% data variables.product.prodname_dotcom %} sets automatically.
19+
20+
You can set a custom variable in two ways.
21+
22+
* To define an environment variable for use in a single workflow, you can use the `env` key in the workflow file. For more information, see [Defining environment variables for a single workflow](/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-environment-variables-for-a-single-workflow).
23+
* To define a configuration variable across multiple workflows, you can define it at the organization, repository, or environment level. For more information, see [Defining configuration variables for multiple workflows](/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-configuration-variables-for-multiple-workflows).
24+
25+
> [!WARNING]
26+
> By default, variables render unmasked in your build outputs. If you need greater security for sensitive information, such as passwords, use secrets instead. For more information, see [AUTOTITLE](/actions/security-for-github-actions/security-guides/about-secrets).
27+
28+
For reference documentation, see [AUTOTITLE](/actions/reference/variables-reference).

content/actions/how-tos/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The following scripting languages are supported:
2727

2828
Your custom scripts can use the following features:
2929

30-
* **Variables:** Scripts have access to the default variables. The full webhook event payload can be found in `GITHUB_EVENT_PATH`. For more information, see [AUTOTITLE](/actions/learn-github-actions/variables#default-environment-variables).
30+
* **Variables:** Scripts have access to the default variables. The full webhook event payload can be found in `GITHUB_EVENT_PATH`. For more information, see [AUTOTITLE](/actions/reference/variables-reference#default-environment-variables).
3131
* **Workflow commands:** Scripts can use workflow commands. For more information, see [AUTOTITLE](/actions/using-workflows/workflow-commands-for-github-actions). Scripts can also use environment files. For more information, see [Environment files](/actions/using-workflows/workflow-commands-for-github-actions#environment-files).
3232

3333
Your script files must use a file extension for the relevant language, such as `.sh` or `.ps1`, in order to run successfully.

content/actions/how-tos/migrating-to-github-actions/manually-migrating-to-github-actions/migrating-from-circleci-to-github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ For more information about the tools and packages available on {% data variables
6767

6868
CircleCI and {% data variables.product.prodname_actions %} support setting variables in the configuration file and creating secrets using the CircleCI or {% data variables.product.github %} UI.
6969

70-
For more information, see [AUTOTITLE](/actions/learn-github-actions/variables#default-environment-variables) and [AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions).
70+
For more information, see [AUTOTITLE](/actions/reference/variables-reference#default-environment-variables) and [AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions).
7171

7272
## Caching
7373

content/actions/how-tos/migrating-to-github-actions/manually-migrating-to-github-actions/migrating-from-travis-ci-to-github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Travis CI lets you set variables and share them between stages. Similarly, {% da
5050

5151
### Default variables
5252

53-
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 [AUTOTITLE](/actions/learn-github-actions/variables#default-environment-variables).
53+
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 [AUTOTITLE](/actions/reference/variables-reference#default-environment-variables).
5454

5555
### Parallel job processing
5656

content/actions/how-tos/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ To ensure proper communications for {% data variables.product.github %}-hosted r
231231
| `workspace` | `GITHUB_WORKSPACE` | Actions and shell commands execute in this directory. An action can modify the contents of this directory, which subsequent actions can access. |
232232
| `workflow/event.json` | `GITHUB_EVENT_PATH` | The `POST` payload of the webhook event that triggered the workflow. {% data variables.product.prodname_dotcom %} rewrites this each time an action executes to isolate file content between actions.
233233

234-
For a list of the environment variables {% data variables.product.prodname_dotcom %} creates for each workflow, see [AUTOTITLE](/actions/learn-github-actions/variables#default-environment-variables).
234+
For a list of the environment variables {% data variables.product.prodname_dotcom %} creates for each workflow, see [AUTOTITLE](/actions/reference/variables-reference#default-environment-variables).
235235

236236
### Docker container filesystem
237237

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.