From f3a1fb3ca79b2d3b4c53e6ede53cb3403f7e2207 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sun, 10 Oct 2021 02:31:30 +0900 Subject: [PATCH] Describe `inputs` context in contexts page --- content/actions/learn-github-actions/contexts.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/actions/learn-github-actions/contexts.md b/content/actions/learn-github-actions/contexts.md index 26e0c71fb4a7..7a7687c8755a 100644 --- a/content/actions/learn-github-actions/contexts.md +++ b/content/actions/learn-github-actions/contexts.md @@ -40,6 +40,7 @@ Contexts are a way to access information about workflow runs, runner environment | `strategy` | `object` | Enables access to the configured strategy parameters and information about the current job. Strategy parameters include `fail-fast`, `job-index`, `job-total`, and `max-parallel`. | | `matrix` | `object` | Enables access to the matrix parameters you configured for the current job. For example, if you configure a matrix build with the `os` and `node` versions, the `matrix` context object includes the `os` and `node` versions of the current job. | | `needs` | `object` | Enables access to the outputs of all jobs that are defined as a dependency of the current job. For more information, see [`needs` context](#needs-context). | +| `inputs` | `object` | Enables access to the inputs of reusable workflow. For more information, see [`inputs` context](#inputs-context). | As part of an expression, you may access context information using one of two syntaxes. - Index syntax: `github['sha']` @@ -147,6 +148,17 @@ The `needs` context contains outputs from all jobs that are defined as a depende | `needs..outputs.` | `string` | The value of a specific output for a job that the current job depends on. | | `needs..result` | `string` | The result of a job that the current job depends on. Possible values are `success`, `failure`, `cancelled`, or `skipped`. | +### `inputs` context + +The `inputs` context contains information about the inputs of reusable workflow. The inputs are defined in [`workflow_call` event configuration](/actions/learn-github-actions/events-that-trigger-workflows#workflow-reuse-events). These inputs are passed from [`jobs..with`](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idwith) in an external workflow. + +For more information, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)". + +| Property name | Type | Description | +|---------------|------|-------------| +| `inputs` | `object` | This context is only available when it is [a reusable workflow](/actions/learn-github-actions/reusing-workflows). | +| `inputs.` | `string` or `number` or `boolean` | Each input value passed from an external workflow. | + #### Example printing context information to the log file To inspect the information that is accessible in each context, you can use this workflow file example.