Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps and switch to autogen docs #292

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 32 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ jobs:

## Inputs

- `secrets`: (Required) The list of secrets to access and inject into the
<!-- BEGIN_AUTOGEN_INPUTS -->

- <a name="secrets"></a><a href="#user-content-secrets"><code>secrets</code></a>: _(Required)_ The list of secrets to access and inject into the
environment. Due to limitations with GitHub Actions inputs, this is
specified as a string.

Expand Down Expand Up @@ -87,39 +89,43 @@ jobs:
<project-id>/<secret-id>
```

- `min_mask_length`: (Optional, default: "4") Minimum line length for a secret
to be masked. Extremely short secrets (e.g. "{" or "a") can make GitHub
Actions log output unreadable. This is especially important for multi-line
secrets, since each line of the secret is masked independently.
- <a name="min_mask_length"></a><a href="#user-content-min_mask_length"><code>min_mask_length</code></a>: _(Optional, default: `4`)_ Minimum line length for a secret to be masked. Extremely short secrets
(e.g. `{` or `a`) can make GitHub Actions log output unreadable. This is
especially important for multi-line secrets, since each line of the secret
is masked independently.

- <a name="export_to_environment"></a><a href="#user-content-export_to_environment"><code>export_to_environment</code></a>: _(Optional)_ Make the fetched secrets additionally available as environment variables.


<!-- END_AUTOGEN_INPUTS -->


## Outputs

Each secret is prefixed with an output name. The secret's resolved access value
will be available at that output in future build steps.
<!-- BEGIN_AUTOGEN_OUTPUTS -->

For example:
- `secrets`: Each secret is prefixed with an output name. The secret's resolved access
value will be available at that output in future build steps. For example:

```yaml
jobs:
job_id:
steps:
- id: 'secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
token:my-project/docker-registry-token
```
```yaml
jobs:
job_id:
steps:
- id: 'secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
token:my-project/docker-registry-token
```

will be available in future steps as the output "token":
will be available in future steps as the output:

```yaml
# other step
- id: 'publish'
uses: 'foo/bar@v1'
env:
TOKEN: '${{ steps.secrets.outputs.token }}'
```
```text
steps.secrets.outputs.token
```


<!-- END_AUTOGEN_OUTPUTS -->


## Authorization
Expand Down
57 changes: 52 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,73 @@ description: |-
inputs:
secrets:
description: |-
Comma-separated or newline-separated list of secrets to fetch. Secrets
must be of the format <project>/<secret> or <project>/<secret>/<version>.
The list of secrets to access and inject into the
environment. Due to limitations with GitHub Actions inputs, this is
specified as a string.

You can specify multiple secrets by putting each secret on its own line:

```yaml
secrets: |-
output1:my-project/my-secret1
output2:my-project/my-secret2
```

Secrets can be referenced using the following formats:

```text
# Long form
projects/<project-id>/secrets/<secret-id>/versions/<version-id>

# Long form - "latest" version
projects/<project-id>/secrets/<secret-id>

# Short form
<project-id>/<secret-id>/<version-id>

# Short form - "latest" version
<project-id>/<secret-id>
```
required: true

min_mask_length:
description: |-
Minimum line length for a secret to be masked. Extremely short secrets
(e.g. "{" or "a") can make GitHub Actions log output unreadable. This is
(e.g. `{` or `a`) can make GitHub Actions log output unreadable. This is
especially important for multi-line secrets, since each line of the secret
is masked independently.
required: false
default: '4'

export_to_environment:
description: |-
This makes the fetched secrets available as environment variables. The
secrets will still be available as output, if you enable this.
Make the fetched secrets additionally available as environment variables.
required: false
default: false

outputs:
secrets:
description: |-
Each secret is prefixed with an output name. The secret's resolved access
value will be available at that output in future build steps. For example:

```yaml
jobs:
job_id:
steps:
- id: 'secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
with:
secrets: |-
token:my-project/docker-registry-token
```

will be available in future steps as the output:

```text
steps.secrets.outputs.token
```

branding:
icon: 'lock'
color: 'blue'
Expand Down
Loading
Loading