1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Fix duplicate headers in the GitHub Actions docs (#34373)

This commit is contained in:
Laura Coursen
2023-02-05 22:53:21 -06:00
committed by GitHub
parent 7576639a04
commit 42a6e62137
9 changed files with 69 additions and 70 deletions

View File

@@ -157,7 +157,7 @@ runs:
main: 'main.js'
```
### `runs.using`
### `runs.using` for JavaScript actions
**Required** The runtime used to execute the code specified in [`main`](#runsmain).
@@ -225,7 +225,7 @@ For example, this `cleanup.js` will only run on Linux-based runners:
**Required** Configures the path to the composite action.
### `runs.using`
### `runs.using` for composite actions
**Required** You must set this value to `'composite'`.
@@ -387,7 +387,7 @@ runs:
image: 'docker://debian:stretch-slim'
```
### `runs.using`
### `runs.using` for Docker container actions
**Required** You must set this value to `'docker'`.

View File

@@ -177,7 +177,6 @@ Stop-Service "{{ service_win_name }}"
```
{% endmac %}
{% linux %}
## Customizing the self-hosted runner service

View File

@@ -51,7 +51,7 @@ The `prepare_job` command is called when a job is started. {% data variables.pro
- Optional: Any context fields you want to set on the job context, otherwise they will be unavailable for users to use. For more information, see "[`job` context](/actions/learn-github-actions/contexts#job-context)."
- Return `0` when the health checks have succeeded and the job/service containers are started.
#### Arguments
#### Arguments for `prepare_job`
- `jobContainer`: **Optional**. An object containing information about the specified job container.
- `image`: **Required**. A string containing the Docker image.
@@ -86,7 +86,7 @@ The `prepare_job` command is called when a job is started. {% data variables.pro
- `serverUrl`: **Optional**. The registry URL.
- `portMappings`: **Optional**. A key value hash of _source:target_ ports to map into the container.
#### Example input
#### Example input for `prepare_job`
```json{:copy}
{
@@ -171,7 +171,7 @@ The `prepare_job` command is called when a job is started. {% data variables.pro
}
```
#### Example output
#### Example output for `prepare_job`
This example output is the contents of the `responseFile` defined in the input above.
@@ -213,11 +213,11 @@ The `cleanup_job` command is called at the end of a job. {% data variables.produ
- Delete the network (if one exists).
- Cleanup anything else that was created for the job.
#### Arguments
#### Arguments for `cleanup_job`
No arguments are provided for `cleanup_job`.
#### Example input
#### Example input for `cleanup_job`
```json{:copy}
{
@@ -234,7 +234,7 @@ No arguments are provided for `cleanup_job`.
}
```
#### Example output
#### Example output for `cleanup_job`
No output is expected for `cleanup_job`.
@@ -247,7 +247,7 @@ The `run_container_step` command is called once for each container action in you
- Stream any step logs output to stdout and stderr.
- Cleanup the container after it executes.
#### Arguments
#### Arguments for `run_container_step`
- `image`: **Optional**. A string containing the docker image. Otherwise a dockerfile must be provided.
- `dockerfile`: **Optional**. A string containing the path to the dockerfile, otherwise an image must be provided.
@@ -423,7 +423,7 @@ If your container is defined by a Dockerfile, this example demonstrates how to s
}
```
#### Example output
#### Example output for `run_container_step`
No output is expected for `run_container_step`.
@@ -434,7 +434,7 @@ No output is expected for `run_container_step`.
- Invoke the provided script inside the job container and return the exit code.
- Stream any step log output to stdout and stderr.
#### Arguments
#### Arguments for `run_script_step`
- `entryPointArgs`: **Optional**. A list containing the entry point arguments.
- `entryPoint`: **Optional**. The container entry point to use if the default image entrypoint should be overwritten.
@@ -442,7 +442,7 @@ No output is expected for `run_container_step`.
- `workingDirectory`: **Required**. A string containing the absolute path of the working directory.
- `environmentVariables`: **Optional**. Sets a map of key environment variables.
#### Example input
#### Example input for `run_script_step`
```json{:copy}
{
@@ -467,7 +467,7 @@ No output is expected for `run_container_step`.
}
```
#### Example output
#### Example output for `run_script_step`
No output is expected for `run_script_step`.

View File

@@ -57,7 +57,7 @@ As part of an expression, you can use `boolean`, `null`, `number`, or `string` d
| `number` | Any number format supported by JSON. |
| `string` | You don't need to enclose strings in `{% raw %}${{{% endraw %}` and `{% raw %}}}{% endraw %}`. However, if you do, you must use single quotes (`'`) around the string. To use a literal single quote, escape the literal single quote using an additional single quote (`''`). Wrapping with double quotes (`"`) will throw an error. |
### Example
### Example of literals
{% raw %}
@@ -147,7 +147,7 @@ For example, `contains(fromJSON('["push", "pull_request"]'), github.event_name)`
Returns `true` when `searchString` starts with `searchValue`. This function is not case sensitive. Casts values to a string.
#### Example
#### Example of `startsWith`
`startsWith('Hello world', 'He')` returns `true`.
@@ -157,7 +157,7 @@ Returns `true` when `searchString` starts with `searchValue`. This function is n
Returns `true` if `searchString` ends with `searchValue`. This function is not case sensitive. Casts values to a string.
#### Example
#### Example of `endsWith`
`endsWith('Hello world', 'ld')` returns `true`.
@@ -167,7 +167,7 @@ Returns `true` if `searchString` ends with `searchValue`. This function is not c
Replaces values in the `string`, with the variable `replaceValueN`. Variables in the `string` are specified using the `{N}` syntax, where `N` is an integer. You must specify at least one `replaceValue` and `string`. There is no maximum for the number of variables (`replaceValueN`) you can use. Escape curly braces using double braces.
#### Example
#### Example of `format`
{% raw %}
```js
@@ -193,7 +193,7 @@ Returns '{Hello Mona the Octocat!}'.
The value for `array` can be an array or a string. All values in `array` are concatenated into a string. If you provide `optionalSeparator`, it is inserted between the concatenated values. Otherwise, the default separator `,` is used. Casts values to a string.
#### Example
#### Example of `join`
`join(github.event.issue.labels.*.name, ', ')` may return 'bug, help wanted'
@@ -203,7 +203,7 @@ The value for `array` can be an array or a string. All values in `array` are con
Returns a pretty-print JSON representation of `value`. You can use this function to debug the information provided in contexts.
#### Example
#### Example of `toJSON`
`toJSON(job)` might return `{ "status": "Success" }`
@@ -297,7 +297,7 @@ You can use the following status check functions as expressions in `if` conditio
Returns `true` when none of the previous steps have failed or been canceled.
#### Example
#### Example of `success`
```yaml
steps:
@@ -310,7 +310,7 @@ steps:
Causes the step to always execute, and returns `true`, even when canceled. A job or step will not run when a critical failure prevents the task from running. For example, if getting sources failed.
#### Example
#### Example of `always`
```yaml
if: {% raw %}${{ always() }}{% endraw %}
@@ -320,7 +320,7 @@ if: {% raw %}${{ always() }}{% endraw %}
Returns `true` if the workflow was canceled.
#### Example
#### Example of `cancelled`
```yaml
if: {% raw %}${{ cancelled() }}{% endraw %}
@@ -330,7 +330,7 @@ if: {% raw %}${{ cancelled() }}{% endraw %}
Returns `true` when any previous step of a job fails. If you have a chain of dependent jobs, `failure()` returns `true` if any ancestor job fails.
#### Example
#### Example of `failure`
```yaml
steps:
@@ -343,7 +343,7 @@ steps:
You can include extra conditions for a step to run after a failure, but you must still include `failure()` to override the default status check of `success()` that is automatically applied to `if` conditions that don't contain a status check function.
##### Example
##### Example of `failure` with conditions
```yaml
steps:

View File

@@ -91,7 +91,7 @@ jobs:
POSTGRES_PORT: 5432
```
### Configuring the runner job
### Configuring the runner job for jobs in containers
{% data reusables.actions.service-container-host %}
@@ -123,7 +123,7 @@ jobs:
--health-retries 5
```
### Configuring the steps
### Configuring the steps for jobs in containers
{% data reusables.actions.service-template-steps %}
@@ -213,7 +213,7 @@ jobs:
POSTGRES_PORT: 5432
```
### Configuring the runner job
### Configuring the runner job for jobs directly on the runner machine
{% data reusables.actions.service-container-host-runner %}
@@ -248,7 +248,7 @@ jobs:
- 5432:5432
```
### Configuring the steps
### Configuring the steps for jobs directly on the runner machine
{% data reusables.actions.service-template-steps %}

View File

@@ -117,7 +117,7 @@ jobs:
--health-retries 5
```
### Configuring the steps
### Configuring the steps for the container job
{% data reusables.actions.service-template-steps %}
@@ -235,7 +235,7 @@ jobs:
- 6379:6379
```
### Configuring the steps
### Configuring the steps for the runner job
{% data reusables.actions.service-template-steps %}

View File

@@ -626,7 +626,7 @@ jobs:
- run: echo 'A review from octo-team was requested'
```
#### Running your workflow based on the head or base branch of a pull request
#### Running your `pull_request` workflow based on the head or base branch of a pull request
You can use the `branches` or `branches-ignore` filter to configure your workflow to only run on pull requests that target specific branches. For more information, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore)."
@@ -673,7 +673,7 @@ jobs:
- run: echo "The head of this PR starts with 'releases/'"
```
#### Running your workflow based on files changed in a pull request
#### Running your `pull_request` workflow based on files changed in a pull request
You can also configure your workflow to run when a pull request changes specific files. For more information, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)."
@@ -703,7 +703,7 @@ on:
{% endnote %}
#### Running your workflow when a pull request merges
#### Running your `pull_request` workflow when a pull request merges
When a pull request merges, the pull request is automatically closed. To run a workflow when a pull request merges, use the `pull_request` `closed` event type along with a conditional that checks the `merged` value of the event. For example, the following workflow will run whenever a pull request closes. The `if_merged` job will only run if the pull request was also merged.
@@ -825,7 +825,7 @@ on:
types: [assigned, opened, synchronize, reopened]
```
#### Running your workflow based on the head or base branch of a pull request
#### Running your `pull_request_target` workflow based on the head or base branch of a pull request
You can use the `branches` or `branches-ignore` filter to configure your workflow to only run on pull requests that target specific branches. For more information, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore)."
@@ -872,7 +872,7 @@ jobs:
- run: echo "The head of this PR starts with 'releases/'"
```
#### Running your workflow based on files changed in a pull request
#### Running your `pull_request_target` workflow based on files changed in a pull request
You can use the `paths` or `paths-ignore` filter to configure your workflow to run when a pull request changes specific files. For more information, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)."
@@ -902,7 +902,7 @@ on:
{% endnote %}
#### Running your workflow when a pull request merges
#### Running your `pull_request_target` workflow when a pull request merges
When a pull request merges, the pull request is automatically closed. To run a workflow when a pull request merges, use the `pull_request_target` `closed` event type along with a conditional that checks the `merged` value of the event. For example, the following workflow will run whenever a pull request closes. The `if_merged` job will only run if the pull request was also merged.

View File

@@ -27,7 +27,7 @@ Actions can communicate with the runner machine to set environment variables, ou
Most workflow commands use the `echo` command in a specific format, while others are invoked by writing to a file. For more information, see "[Environment files](#environment-files)."
### Example
### Example of a workflow command
{% bash %}
@@ -643,7 +643,7 @@ echo "{environment_variable_name}={value}" >> $GITHUB_ENV
You can make an environment variable available to any subsequent steps in a workflow job by defining or updating the environment variable and writing this to the `GITHUB_ENV` environment file. The step that creates or updates the environment variable does not have access to the new value, but all subsequent steps in a job will have access. The names of environment variables are case-sensitive, and you can include punctuation. For more information, see "[Environment variables](/actions/learn-github-actions/environment-variables)."
### Example
### Example of writing an environment variable to `GITHUB_ENV`
{% bash %}
@@ -697,7 +697,7 @@ For multiline strings, you may use a delimiter with the following syntax.
{% endwarning %}
#### Example
#### Example of a multiline string
This example uses `EOF` as a delimiter, and sets the `JSON_RESPONSE` environment variable to the value of the `curl` response.
@@ -750,7 +750,7 @@ echo "{name}={value}" >> $GITHUB_OUTPUT
{% endpowershell %}
### Example
### Example of setting an output parameter
{% bash %}
@@ -812,7 +812,7 @@ Job summaries support [{% data variables.product.prodname_dotcom %} flavored Mar
When a job finishes, the summaries for all steps in a job are grouped together into a single job summary and are shown on the workflow run summary page. If multiple jobs generate summaries, the job summaries are ordered by job completion time.
### Example
### Example of adding a job summary
{% bash %}
@@ -836,7 +836,7 @@ echo "### Hello world! :rocket:" >> $GITHUB_STEP_SUMMARY
For multiline Markdown content, you can use `>>` to continuously append content for the current step. With every append operation, a newline character is automatically added.
#### Example
#### Example of multiline Markdown content
{% bash %}
@@ -870,7 +870,7 @@ For multiline Markdown content, you can use `>>` to continuously append content
To clear all content for the current step, you can use `>` to overwrite any previously added content.
#### Example
#### Example of overwriting job summaries
{% bash %}
@@ -898,7 +898,7 @@ To clear all content for the current step, you can use `>` to overwrite any prev
To completely remove a summary for the current step, the file that `GITHUB_STEP_SUMMARY` references can be deleted.
#### Example
#### Example of removing job summaries
{% bash %}
@@ -949,7 +949,7 @@ echo "{path}" >> $GITHUB_PATH
{% endpowershell %}
### Example
### Example of adding a system path
{% bash %}

View File

@@ -36,7 +36,7 @@ The name for workflow runs generated from the workflow. {% data variables.produc
This value can include expressions and can reference the [`github`](/actions/learn-github-actions/contexts#github-context) and [`inputs`](/actions/learn-github-actions/contexts#inputs-context) contexts.
### Example
### Example of `run-name`
{% raw %}
```yaml
@@ -88,7 +88,7 @@ Within the called workflow, you can use the `inputs` context to refer to an inpu
If a caller workflow passes an input that is not specified in the called workflow, this results in an error.
#### Example
#### Example of `on.workflow_call.inputs`
{% raw %}
```yaml
@@ -123,7 +123,7 @@ A map of outputs for a called workflow. Called workflow outputs are available to
In the example below, two outputs are defined for this reusable workflow: `workflow_output1` and `workflow_output2`. These are mapped to outputs called `job_output1` and `job_output2`, both from a job called `my_job`.
#### Example
#### Example of `on.workflow_call.outputs`
{% raw %}
```yaml
@@ -156,7 +156,7 @@ Within the called workflow, you can use the `secrets` context to refer to a secr
If a caller workflow passes a secret that is not specified in the called workflow, this results in an error.
#### Example
#### Example of `on.workflow_call.secrets`
{% raw %}
```yaml
@@ -215,7 +215,7 @@ Variables in the `env` map cannot be defined in terms of other variables in the
{% data reusables.repositories.actions-env-var-note %}
### Example
### Example of `env`
```yaml
env:
@@ -280,7 +280,7 @@ A `map` of variables that are available to all steps in the job. You can set var
{% data reusables.repositories.actions-env-var-note %}
### Example
### Example of `jobs.<job_id>.env`
```yaml
jobs:
@@ -303,7 +303,7 @@ A job contains a sequence of tasks called `steps`. Steps can run commands, run s
You can run an unlimited number of steps as long as you are within the workflow usage limits. For more information, see {% ifversion fpt or ghec or ghes %}"[Usage limits and billing](/actions/reference/usage-limits-billing-and-administration)" for {% data variables.product.prodname_dotcom %}-hosted runners and {% endif %}"[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits){% ifversion fpt or ghec or ghes %}" for self-hosted runner usage limits.{% elsif ghae %}."{% endif %}
### Example
### Example of `jobs.<job_id>.steps`
{% raw %}
```yaml
@@ -667,7 +667,7 @@ For built-in shell keywords, we provide the following defaults that are executed
A `map` of the input parameters defined by the action. Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with `INPUT_` and converted to upper case.
#### Example
#### Example of `jobs.<job_id>.steps[*].with`
Defines the three input parameters (`first_name`, `middle_name`, and `last_name`) defined by the `hello_world` action. These input variables will be accessible to the `hello-world` action as `INPUT_FIRST_NAME`, `INPUT_MIDDLE_NAME`, and `INPUT_LAST_NAME` environment variables.
@@ -687,7 +687,7 @@ jobs:
A `string` that defines the inputs for a Docker container. {% data variables.product.prodname_dotcom %} 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 `""`.
#### Example
#### Example of `jobs.<job_id>.steps[*].with.args`
{% raw %}
```yaml
@@ -710,7 +710,7 @@ The `args` are used in place of the `CMD` instruction in a `Dockerfile`. If you
Overrides the Docker `ENTRYPOINT` in the `Dockerfile`, or sets it if one wasn't already specified. Unlike the Docker `ENTRYPOINT` instruction which has a shell and exec form, `entrypoint` keyword accepts only a single string defining the executable to be run.
#### Example
#### Example of `jobs.<job_id>.steps[*].with.entrypoint`
```yaml
steps:
@@ -730,7 +730,7 @@ Sets variables for steps to use in the runner environment. You can also set vari
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. For more information, see "[Contexts](/actions/learn-github-actions/contexts)."
#### Example
#### Example of `jobs.<job_id>.steps[*].env`
{% raw %}
```yaml
@@ -900,7 +900,7 @@ The Docker image to use as the service container to run the action. The value ca
{% data reusables.actions.registry-credentials %}
#### Example
#### Example of `jobs.<job_id>.services.<service_id>.credentials`
{% raw %}
```yaml
@@ -936,7 +936,7 @@ To specify a volume, you specify the source and destination path:
The `<source>` is a volume name or an absolute path on the host machine, and `<destinationPath>` is an absolute path in the container.
#### Example
#### Example of `jobs.<job_id>.services.<service_id>.volumes`
```yaml
volumes:
@@ -964,7 +964,7 @@ The location and version of a reusable workflow file to run as a job. {% ifversi
{% data reusables.actions.reusable-workflow-calling-syntax %}
### Example
### Example of `jobs.<job_id>.uses`
{% data reusables.actions.uses-keyword-example %}
@@ -978,7 +978,7 @@ Any inputs that you pass must match the input specifications defined in the call
Unlike [`jobs.<job_id>.steps[*].with`](#jobsjob_idstepswith), the inputs you pass with `jobs.<job_id>.with` are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the `inputs` context.
#### Example
#### Example of `jobs.<job_id>.with`
```yaml
jobs:
@@ -1018,7 +1018,7 @@ jobs:
Use the `inherit` keyword to pass all the calling workflow's secrets to the called workflow. This includes all secrets the calling workflow has access to, namely organization, repository, and environment secrets. The `inherit` keyword can be used to pass secrets across repositories within the same organization, or across organizations within the same enterprise.
#### Example
#### Example of `jobs.<job_id>.secrets.inherit`
{% raw %}