Skip to content

Commit 59cf22d

Browse files
authored
Update deps and switch to autogen docs (#292)
1 parent 3d36df9 commit 59cf22d

File tree

4 files changed

+187
-165
lines changed

4 files changed

+187
-165
lines changed

README.md

+32-26
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ jobs:
5959
6060
## Inputs
6161
62-
- `secrets`: (Required) The list of secrets to access and inject into the
62+
<!-- BEGIN_AUTOGEN_INPUTS -->
63+
64+
- <a name="secrets"></a><a href="#user-content-secrets"><code>secrets</code></a>: _(Required)_ The list of secrets to access and inject into the
6365
environment. Due to limitations with GitHub Actions inputs, this is
6466
specified as a string.
6567
@@ -87,39 +89,43 @@ jobs:
8789
<project-id>/<secret-id>
8890
```
8991

90-
- `min_mask_length`: (Optional, default: "4") Minimum line length for a secret
91-
to be masked. Extremely short secrets (e.g. "{" or "a") can make GitHub
92-
Actions log output unreadable. This is especially important for multi-line
93-
secrets, since each line of the secret is masked independently.
92+
- <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
93+
(e.g. `{` or `a`) can make GitHub Actions log output unreadable. This is
94+
especially important for multi-line secrets, since each line of the secret
95+
is masked independently.
96+
97+
- <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.
98+
99+
100+
<!-- END_AUTOGEN_INPUTS -->
94101

95102

96103
## Outputs
97104

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

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

103-
```yaml
104-
jobs:
105-
job_id:
106-
steps:
107-
- id: 'secrets'
108-
uses: 'google-github-actions/get-secretmanager-secrets@v2'
109-
with:
110-
secrets: |-
111-
token:my-project/docker-registry-token
112-
```
110+
```yaml
111+
jobs:
112+
job_id:
113+
steps:
114+
- id: 'secrets'
115+
uses: 'google-github-actions/get-secretmanager-secrets@v2'
116+
with:
117+
secrets: |-
118+
token:my-project/docker-registry-token
119+
```
113120

114-
will be available in future steps as the output "token":
121+
will be available in future steps as the output:
115122

116-
```yaml
117-
# other step
118-
- id: 'publish'
119-
uses: 'foo/bar@v1'
120-
env:
121-
TOKEN: '${{ steps.secrets.outputs.token }}'
122-
```
123+
```text
124+
steps.secrets.outputs.token
125+
```
126+
127+
128+
<!-- END_AUTOGEN_OUTPUTS -->
123129

124130

125131
## Authorization

action.yml

+52-5
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,73 @@ description: |-
2121
inputs:
2222
secrets:
2323
description: |-
24-
Comma-separated or newline-separated list of secrets to fetch. Secrets
25-
must be of the format <project>/<secret> or <project>/<secret>/<version>.
24+
The list of secrets to access and inject into the
25+
environment. Due to limitations with GitHub Actions inputs, this is
26+
specified as a string.
27+
28+
You can specify multiple secrets by putting each secret on its own line:
29+
30+
```yaml
31+
secrets: |-
32+
output1:my-project/my-secret1
33+
output2:my-project/my-secret2
34+
```
35+
36+
Secrets can be referenced using the following formats:
37+
38+
```text
39+
# Long form
40+
projects/<project-id>/secrets/<secret-id>/versions/<version-id>
41+
42+
# Long form - "latest" version
43+
projects/<project-id>/secrets/<secret-id>
44+
45+
# Short form
46+
<project-id>/<secret-id>/<version-id>
47+
48+
# Short form - "latest" version
49+
<project-id>/<secret-id>
50+
```
2651
required: true
2752

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

3762
export_to_environment:
3863
description: |-
39-
This makes the fetched secrets available as environment variables. The
40-
secrets will still be available as output, if you enable this.
64+
Make the fetched secrets additionally available as environment variables.
4165
required: false
4266
default: false
4367

68+
outputs:
69+
secrets:
70+
description: |-
71+
Each secret is prefixed with an output name. The secret's resolved access
72+
value will be available at that output in future build steps. For example:
73+
74+
```yaml
75+
jobs:
76+
job_id:
77+
steps:
78+
- id: 'secrets'
79+
uses: 'google-github-actions/get-secretmanager-secrets@v2'
80+
with:
81+
secrets: |-
82+
token:my-project/docker-registry-token
83+
```
84+
85+
will be available in future steps as the output:
86+
87+
```text
88+
steps.secrets.outputs.token
89+
```
90+
4491
branding:
4592
icon: 'lock'
4693
color: 'blue'

0 commit comments

Comments
 (0)