Skip to content

Commit

Permalink
docs: add info reusable workflow inputs always string vars
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jan 22, 2024
1 parent dc8cc6d commit d3c4c8f
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ As you can see, `uses` is to define the workflow you want to run:
The `with` key is used to specify all of the **inputs** to pass to the workflow.
(these are predefined by the creator of the reusable workflow).

> Note that inputs are **always** string variables.
> So keep this in mind when creating conditionals (use inputs.var == 'true').
>
> The `type` field is not supported for reusable workflow inputs, yet.

### Using Secrets in Reusable Workflows

By default reusable workflows will not have access to environment
Expand All @@ -136,23 +141,23 @@ There are two ways to do this:

1. Specify secrets individually:

```yaml
jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/some_workflow.yml@main
secrets:
SECRET_VAR_1: ${{ secrets.SECRET_VAR_1 }}
SECRET_VAR_2: ${{ secrets.SECRET_VAR_2 }}
```
```yaml
jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/some_workflow.yml@main
secrets:
SECRET_VAR_1: ${{ secrets.SECRET_VAR_1 }}
SECRET_VAR_2: ${{ secrets.SECRET_VAR_2 }}
```

2. Inherit all secrets (recommended):

```yaml
jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/some_workflow.yml@main
secrets: inherit
```
```yaml
jobs:
pytest:
uses: hotosm/gh-workflows/.github/workflows/some_workflow.yml@main
secrets: inherit
```

## Passing Info Between Workflows

Expand Down

0 comments on commit d3c4c8f

Please sign in to comment.