You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -284,49 +285,64 @@ A workflow created in a repository can access the following number of secrets:
284
285
* If the repository is assigned access to more than 100 organization secrets, the workflow can only use the first 100 organization secrets (sorted alphabetically by secret name).
285
286
* All 100 environment secrets.
286
287
287
-
Secrets are limited to 64 KB in size. To use secrets that are larger than 64 KB, you can store encrypted secrets in your repository and save the decryption passphrase as a secret on {% data variables.product.prodname_dotcom %}. For example, you can use `gpg` to encrypt your credentials locally before checking the file in to your repository on {% data variables.product.prodname_dotcom %}. For more information, see the "[gpg manpage](https://www.gnupg.org/gph/de/manual/r1023.html)."
288
+
Secrets are limited to 64 KB in size. To store larger secrets, see the "[Storing large secrets](#storing-large-secrets)" workaround below.
289
+
290
+
### Storing large secrets
291
+
292
+
To use secrets that are larger than 64 KB, you can use a workaround to store encrypted secrets in your repository and save the decryption passphrase as a secret on {% data variables.product.prodname_dotcom %}. For example, you can use `gpg` to encrypt a file containing your secret locally before checking the encrypted file in to your repository on {% data variables.product.prodname_dotcom %}. For more information, see the "[gpg manpage](https://www.gnupg.org/gph/de/manual/r1023.html)."
288
293
289
294
{% warning %}
290
295
291
-
**Warning**: Be careful that your secrets do not get printed when your action runs. When using this workaround, {% data variables.product.prodname_dotcom %} does not redact secrets that are printed in logs.
296
+
**Warning**: Be careful that your secrets do not get printed when your workflow runs. When using this workaround, {% data variables.product.prodname_dotcom %} does not redact secrets that are printed in logs.
292
297
293
298
{% endwarning %}
294
299
295
-
1. Run the following command from your terminal to encrypt the `my_secret.json` file using `gpg` and the AES256 cipher algorithm.
300
+
1. Run the following command from your terminal to encrypt the file containing your secret using `gpg` and the AES256 cipher algorithm. In this example, `my_secret.json` is the file containing the secret.
1. You will be prompted to enter a passphrase. Remember the passphrase, because you'll need to create a new secret on {% data variables.product.prodname_dotcom %} that uses the passphrase as the value.
302
307
303
-
1. Create a new secret that contains the passphrase. For example, create a new secret with the name `LARGE_SECRET_PASSPHRASE` and set the value of the secret to the passphrase you selected in the step above.
308
+
1. Create a new secret that contains the passphrase. For example, create a new secret with the name `LARGE_SECRET_PASSPHRASE` and set the value of the secret to the passphrase you used in the step above.
309
+
310
+
1. Copy your encrypted file to a path in your repository and commit it. In this example, the encrypted file is `my_secret.json.gpg`.
311
+
312
+
{% warning %}
304
313
305
-
1. Copy your encrypted file into your repository and commit it. In this example, the encrypted file is `my_secret.json.gpg`.
314
+
**Warning**: Make sure to copy the encrypted `my_secret.json.gpg` file ending with the `.gpg` file extension, and **not** the unencrypted `my_secret.json` file.
306
315
307
-
1. Create a shell script to decrypt the password. Save this file as `decrypt_secret.sh`.
316
+
{% endwarning %}
308
317
309
-
``` shell
310
-
#!/bin/sh
318
+
```bash
319
+
git add my_secret.json.gpg
320
+
git commit -m "Add new encrypted secret JSON file"
321
+
```
322
+
323
+
1. Create a shell script in your repository to decrypt the secret file. In this example, the script is named `decrypt_secret.sh`.
1. Ensure your shell script is executable before checking it in to your repository.
321
337
322
-
``` shell
323
-
$ chmod +x decrypt_secret.sh
324
-
$ git add decrypt_secret.sh
325
-
$ git commit -m "Add new decryption script"
326
-
$ git push
327
-
```
338
+
```bash
339
+
chmod +x decrypt_secret.sh
340
+
git add decrypt_secret.sh
341
+
git commit -m "Add new decryption script"
342
+
git push
343
+
```
328
344
329
-
1. From your workflow, use a `step` to call the shell script and decrypt the secret. To have a copy of your repository in the environment that your workflow runs in, you'll need to use the [`actions/checkout`](https://github.com/actions/checkout) action. Reference your shell script using the `run` command relative to the root of your repository.
345
+
1. In your {% data variables.product.prodname_actions %} workflow, use a `step` to call the shell script and decrypt the secret. To have a copy of your repository in the environment that your workflow runs in, you'll need to use the [`actions/checkout`](https://github.com/actions/checkout) action. Reference your shell script using the `run` command relative to the root of your repository.
330
346
331
347
```yaml
332
348
name: Workflows with large secrets
@@ -340,7 +356,7 @@ Secrets are limited to 64 KB in size. To use secrets that are larger than 64 KB,
340
356
steps:
341
357
- uses: {% data reusables.actions.action-checkout %}
342
358
- name: Decrypt large secret
343
-
run: ./.github/scripts/decrypt_secret.sh
359
+
run: ./decrypt_secret.sh
344
360
env:
345
361
LARGE_SECRET_PASSPHRASE: {% raw %}${{ secrets.LARGE_SECRET_PASSPHRASE }}{% endraw %}
346
362
# This command is just an example to show your secret being printed
0 commit comments