Scripts you specify in `after_script` execute in a new shell, separate from any
`before_script` or `script` commands. As a result, they:
- Have the current working directory set back to the default (according to the [variables which define how the runner processes Git requests](#configure-runner-behavior-with-variables)).
- Have the current working directory set back to the default (according to the [variables which define how the runner processes Git requests](../runners/configure_runners.md#configure-runner-behavior-with-variables)).
- Don't have access to changes done by commands defined in the `before_script` or `script`,
including:
- Command aliases and variables exported in `script` scripts.
...
...
@@ -4274,24 +4274,25 @@ karma:
## `variables`
> Introduced in GitLab Runner v0.5.0.
[CI/CD variables](../variables/index.md) are configurable values that are passed to jobs.
They can be set globally and per-job.
Use `variables` to create [custom variables](../variables/index.md#custom-cicd-variables).
Variables are always available in `script`, `before_script`, and `after_script` commands.
You can also use variables as inputs in some job keywords.
There are two types of variables.
**Keyword type**: Global and job keyword. You can use it at the global level,
You can use only integers and strings for the variable's name and value.
If you define a variable at the top level of the `.gitlab-ci.yml` file, it is global,
meaning it applies to all jobs. If you define a variable in a job, it's available
to that job only.
**Additional details**:
If a variable of the same name is defined globally and for a specific job, the
[job-specific variable overrides the global variable](../variables/index.md#cicd-variable-precedence).
- All YAML-defined variables are also set to any linked [Docker service containers](../services/index.md).
- YAML-defined variables are meant for non-sensitive project configuration. Store sensitive information
in [protected variables](../variables/index.md#protect-a-cicd-variable) or [CI/CD secrets](../secrets/index.md).
All YAML-defined variables are also set to any linked
[Docker service containers](../services/index.md).
**Related topics**:
You can use [YAML anchors for variables](yaml_specific_features.md#yaml-anchors-for-variables).
- You can use [YAML anchors for variables](yaml_specific_features.md#yaml-anchors-for-variables).
-[Predefined variables](../variables/predefined_variables.md) are variables the runner
automatically creates and makes available in the job.
- You can [configure runner behavior with variables](../runners/configure_runners.md#configure-runner-behavior-with-variables).
### Prefill variables in manual pipelines
### `variables:description`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/30101) in GitLab 13.7.
Use the `value` and `description` keywords to define [pipeline-level (global) variables that are prefilled](../pipelines/index.md#prefill-variables-in-manual-pipelines)
when [running a pipeline manually](../pipelines/index.md#run-a-pipeline-manually):
Use the `description` keyword to define a [pipeline-level (global) variable that is prefilled](../pipelines/index.md#prefill-variables-in-manual-pipelines)
when [running a pipeline manually](../pipelines/index.md#run-a-pipeline-manually).
Must be used with `value`, for the variable value.
**Keyword type**: Global keyword. You cannot set job-level variables to be pre-filled when you run a pipeline manually.