For more information, see " Workflow commands for GitHub Actions." This file is unique to the current step and is a different file for each step in a job. Path on the runner to the file that sets environment variables from workflow commands. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target. The base_ref or target branch of the pull request in a workflow run. Note that this is different from the actor username. The account ID of the person or app that triggered the initial workflow run. Any workflow re-runs will use the privileges of github.actor, even if the actor initiating the re-run ( iggering_actor) has different privileges. If the workflow run is a re-run, this value may differ from iggering_actor. The username of the user that triggered the initial workflow run. For example, actions/checkout.įor a composite action, the current result of the composite action. For example, v2.įor a step executing an action, this is the owner and repository name of the action. ![]() įor a step executing an action, this is the ref of the action being executed. The following example demonstrates how these different types of variables can be used together in a job: name: CI on: push jobs: prod-check: if: $. For details of where you can use various contexts within a workflow, see " Contexts." Once the job is running, you can also retrieve context variables from the runner that is executing the job, such as runner.os. 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. Contexts: You can use most contexts at any point in your workflow, including when default variables would be unavailable.Default environment variables: These environment variables exist only on the runner that is executing your job.These variables are intended for use at different points in the workflow: GitHub Actions includes a collection of variables called contexts and a similar collection of variables called default variables. If you attempt to dereference a non-existent property, it will evaluate to an empty string. In order to use property dereference syntax, the property name must start with a letter or _ and contain only alphanumeric characters, -, or _. Property dereference syntax: github.sha.For more information, see inputs context.Īs part of an expression, you can access context information using one of two syntaxes. For more information, see needs context.Ĭontains the inputs of a reusable or manually triggered workflow. For more information, see matrix context.Ĭontains the outputs of all jobs that are defined as a dependency of the current job. For more information, see strategy context.Ĭontains the matrix properties defined in the workflow that apply to the current job. Information about the matrix execution strategy for the current job. ![]() For more information, see secrets context. For more information, see runner context.Ĭontains the names and values of secrets that are available to a workflow run. Information about the runner that is running the current job. Information about the steps that have been run in the current job. For more information, see job context.įor reusable workflows only, contains outputs of jobs from the reusable workflow. Information about the currently running job. For more information, see env context.Ĭontains variables set at the repository, organization, or environment levels. For more information, see github context.Ĭontains variables set in a workflow, job, or step. For more information, see " Security hardening for GitHub Actions." Context name Certain contexts should be treated as untrusted input, as an attacker could insert their own malicious content. Warning: When creating workflows and actions, you should always consider whether your code might execute untrusted input from possible attackers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |