This commit is contained in:
JMARyA 2024-02-12 15:32:44 +01:00
parent b911a95873
commit e7a85e5e00
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
11 changed files with 47 additions and 47 deletions

View file

@ -39,7 +39,7 @@ You can use expressions to programmatically set [environment variables](../linux
Expressions are commonly used with the conditional `if` keyword in a workflow file to determine whether a step should run. When an `if` conditional is `true`, the step will run.
You need to use specific syntax to tell [GitHub](GitHub.md) to evaluate an expression rather than treat it as a string.
You need to use specific syntax to tell [GitHub](../applications/development/GitHub.md) to evaluate an expression rather than treat it as a string.
`${{ <expression> }}`
Secrets passed to GitHub Actions can be used:
@ -93,7 +93,7 @@ Workflows are defined in the `.github/workflows` directory in a repository, and
### Syntax
#### `name`
The name of the workflow. [GitHub](GitHub.md) displays the names of your workflows under your repository's "Actions" tab. If you omit `name`, [GitHub](GitHub.md) displays the workflow file path relative to the root of the repository.
The name of the workflow. [GitHub](../applications/development/GitHub.md) displays the names of your workflows under your repository's "Actions" tab. If you omit `name`, [GitHub](../applications/development/GitHub.md) displays the workflow file path relative to the root of the repository.
#### `on`
To automatically trigger a workflow, use `on` to define which events can cause the workflow to run.
@ -147,7 +147,7 @@ on:
```
#### `on.<event_name>.types`
Use `on.<event_name>.types` to define the type of activity that will trigger a workflow run. Most [GitHub](GitHub.md) events are triggered by more than one type of activity. For example, the `label` is triggered when a label is `created`, `edited`, or `deleted`. The `types` keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a [webhook](../internet/Webhook.md) event, the `types` keyword is unnecessary.
Use `on.<event_name>.types` to define the type of activity that will trigger a workflow run. Most [GitHub](../applications/development/GitHub.md) events are triggered by more than one type of activity. For example, the `label` is triggered when a label is `created`, `edited`, or `deleted`. The `types` keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a [webhook](../internet/Webhook.md) event, the `types` keyword is unnecessary.
```yaml
on:
@ -206,7 +206,7 @@ Each job runs in a runner environment specified by `runs-on`.
##### `jobs.<job_id>`
Use `jobs.<job_id>` to give your job a unique identifier. The key `job_id` is a string and its value is a map of the job's configuration data. You must replace `<job_id>` with a string that is unique to the `jobs` object. The `<job_id>` must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
Use `jobs.<job_id>.name` to set a name for the job, which is displayed in the [GitHub](GitHub.md) UI.
Use `jobs.<job_id>.name` to set a name for the job, which is displayed in the [GitHub](../applications/development/GitHub.md) UI.
**Example: Creating jobs:**
In this example, two jobs have been created, and their `job_id` values are `my_first_job` and `my_second_job`.
@ -287,7 +287,7 @@ Use `jobs.<job_id>.runs-on` to define the type of machine to run the job on.
A `map` of variables that are available to all steps in the job. You can set variables for the entire workflow or an individual step.
##### `jobs.<job_id>.steps`
A job contains a sequence of tasks called `steps`. Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a [Docker](../tools/Docker.md) registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the runner environment and has access to the workspace and filesystem. Because steps run in their own process, changes to [environment variables](../linux/Environment%20Variables.md) are not preserved between steps. [GitHub](GitHub.md) provides built-in steps to set up and complete a job.
A job contains a sequence of tasks called `steps`. Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a [Docker](../tools/Docker.md) registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the runner environment and has access to the workspace and filesystem. Because steps run in their own process, changes to [environment variables](../linux/Environment%20Variables.md) are not preserved between steps. [GitHub](../applications/development/GitHub.md) provides built-in steps to set up and complete a job.
**Example of `jobs.<job_id>.steps`:**
```yaml
@ -313,7 +313,7 @@ jobs:
- `jobs.<job_id>.steps[*].if`
You can use the `if` conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.
- `jobs.<job_id>.steps[*].name`
A name for your step to display on [GitHub](GitHub.md).
A name for your step to display on [GitHub](../applications/development/GitHub.md).
- `jobs.<job_id>.steps[*].uses`
Selects an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published [Docker](../tools/Docker.md) container image.
@ -377,11 +377,11 @@ jobs:
last_name: Octocat
```
- `jobs.<job_id>.steps[*].with.args`
A `string` that defines the inputs for a [Docker](../tools/Docker.md) container. [GitHub](GitHub.md) passes the `args` to the container's `ENTRYPOINT` when the container starts up. An `array of strings` is not supported by this parameter. A single argument that includes spaces should be surrounded by double quotes `""`.
A `string` that defines the inputs for a [Docker](../tools/Docker.md) container. [GitHub](../applications/development/GitHub.md) passes the `args` to the container's `ENTRYPOINT` when the container starts up. An `array of strings` is not supported by this parameter. A single argument that includes spaces should be surrounded by double quotes `""`.
- `jobs.<job_id>.steps[*].env`
Sets variables for steps to use in the runner environment. You can also set variables for the entire workflow or a job. For more information, see `env` and `jobs.<job_id>.env`.
When more than one environment variable is defined with the same name, [GitHub](GitHub.md) uses the most specific variable. For example, an environment variable defined in a step will override job and workflow [environment variables](../linux/Environment%20Variables.md) with the same name, while the step executes. An environment variable defined for a job will override a workflow variable with the same name, while the job executes.
When more than one environment variable is defined with the same name, [GitHub](../applications/development/GitHub.md) uses the most specific variable. For example, an environment variable defined in a step will override job and workflow [environment variables](../linux/Environment%20Variables.md) with the same name, while the step executes. An environment variable defined for a job will override a workflow variable with the same name, while the job executes.
Public actions may specify expected variables in the README file. If you are setting a secret or sensitive value, such as a password or token, you must set secrets using the `secrets` context.
@ -396,7 +396,7 @@ steps:
```
## Events
An event is a specific activity in a repository that triggers a workflow run. For example, activity can originate from [GitHub](GitHub.md) when someone creates a pull request, opens an issue, or pushes a commit to a repository. You can also trigger a workflow to run on a schedule, by posting to a REST API, or manually.
An event is a specific activity in a repository that triggers a workflow run. For example, activity can originate from [GitHub](../applications/development/GitHub.md) when someone creates a pull request, opens an issue, or pushes a commit to a repository. You can also trigger a workflow to run on a schedule, by posting to a REST API, or manually.
### `create`
Runs your workflow when someone creates a [Git](Git.md) reference ([Git](Git.md) branch or tag) in the workflow's repository.
@ -612,7 +612,7 @@ on:
```
### `workflow_dispatch`
To enable a workflow to be triggered manually, you need to configure the `workflow_dispatch` event. You can manually trigger a workflow run using the [GitHub](GitHub.md) API, [GitHub](GitHub.md) CLI, or [GitHub](GitHub.md) browser interface.
To enable a workflow to be triggered manually, you need to configure the `workflow_dispatch` event. You can manually trigger a workflow run using the [GitHub](../applications/development/GitHub.md) API, [GitHub](../applications/development/GitHub.md) CLI, or [GitHub](../applications/development/GitHub.md) browser interface.
```yaml
on: workflow_dispatch
@ -624,6 +624,6 @@ A job is a set of _steps_ in a workflow that is executed on the same runner. Eac
You can configure a job's dependencies with other jobs; by default, jobs have no dependencies and run in parallel with each other. When a job takes a dependency on another job, it will wait for the dependent job to complete before it can run. For example, you may have multiple build jobs for different architectures that have no dependencies, and a packaging job that is dependent on those jobs. The build jobs will run in parallel, and when they have all completed successfully, the packaging job will run.
## Actions
An _action_ is a custom application for the GitHub Actions platform that performs a complex but frequently repeated task. Use an action to help reduce the amount of repetitive code that you write in your workflow files. An action can pull your [git](Git.md) repository from [GitHub](GitHub.md), set up the correct toolchain for your build environment, or set up the authentication to your cloud provider.
An _action_ is a custom application for the GitHub Actions platform that performs a complex but frequently repeated task. Use an action to help reduce the amount of repetitive code that you write in your workflow files. An action can pull your [git](Git.md) repository from [GitHub](../applications/development/GitHub.md), set up the correct toolchain for your build environment, or set up the authentication to your cloud provider.
You can write your own actions, or you can find actions to use in your workflows in the GitHub Marketplace.