Skip to content

Commit 311b7f3

Browse files
authored
Merge pull request #39221 from github/repo-sync
Repo sync
2 parents 8202d01 + 89ef89a commit 311b7f3

File tree

15 files changed

+89
-97
lines changed

15 files changed

+89
-97
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
22
title: Security in GitHub Actions
33
shortTitle: Security
4-
intro: "Learn about security as a concept in GitHub Actions."
4+
intro: Learn about security as a concept in GitHub Actions.
55
versions:
66
fpt: '*'
77
ghes: '*'
88
ghec: '*'
99
children:
10-
- /about-secrets
10+
- /secrets
1111
- /about-security-hardening-with-openid-connect
1212
---
13+

content/actions/concepts/security/about-secrets.md renamed to content/actions/concepts/security/secrets.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,31 @@
11
---
2-
title: About secrets
3-
intro: 'Learn about secrets as they''re used in GitHub Actions.'
2+
title: Secrets
3+
intro: Learn about secrets as they are used in {% data variables.product.prodname_actions %} workflows.
44
versions:
55
fpt: '*'
66
ghes: '*'
77
ghec: '*'
88
redirect_from:
99
- /actions/security-for-github-actions/security-guides/about-secrets
10+
- /actions/concepts/security/about-secrets
1011
---
1112

12-
{% data reusables.actions.enterprise-github-hosted-runners %}
13-
1413
## About secrets
1514

1615
Secrets allow you to store sensitive information in your organization, repository, or repository environments. Secrets are variables that you create to use in {% data variables.product.prodname_actions %} workflows in an organization, repository, or repository environment.
1716

1817
{% data variables.product.prodname_actions %} can only read a secret if you explicitly include the secret in a workflow.
1918

20-
## Naming your secrets
21-
22-
>[!TIP]
23-
> To help ensure that {% data variables.product.prodname_dotcom %} redacts your secrets in logs correctly, avoid using structured data as the values of secrets.
24-
25-
The following rules apply to secret names:
26-
27-
{% data reusables.actions.actions-secrets-and-variables-naming %}
28-
29-
{% data reusables.codespaces.secret-precedence %} Similarly, if an organization, repository, and environment all have a secret with the same name, the environment-level secret takes precedence.
30-
31-
## Using your secrets in workflows
32-
33-
{% data reusables.actions.secrets-redaction-warning %}
19+
## Organization-level secrets
3420

3521
{% data reusables.actions.secrets-org-level-overview %}
3622

23+
When creating a secret for an organization, you can use a policy to limit access by repository. For example, you can grant access to all repositories, or limit access to only private repositories or a specified list of repositories.
24+
3725
For environment secrets, you can enable required reviewers to control access to the secrets. A workflow job cannot access environment secrets until approval is granted by required approvers.
3826

3927
To make a secret available to an action, you must set the secret as an input or environment variable in your workflow file. Review the action's README file to learn about which inputs and environment variables the action expects. See [AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv).
4028

41-
Organization and repository secrets are read when a workflow run is queued, and environment secrets are read when a job referencing the environment starts.
42-
4329
## Limiting credential permissions
4430

4531
When generating credentials, we recommend that you grant the minimum permissions possible. For example, instead of using personal credentials, use [deploy keys](/authentication/connecting-to-github-with-ssh/managing-deploy-keys#deploy-keys) or a service account. Consider granting read-only permissions if that's all that is needed, and limit access as much as possible.
@@ -48,6 +34,18 @@ When generating a {% data variables.product.pat_v1 %}, select the fewest scopes
4834

4935
Instead of using a {% data variables.product.pat_generic %}, consider using a {% data variables.product.prodname_github_app %}, which uses fine-grained permissions and short lived tokens, similar to a {% data variables.product.pat_v2 %}. Unlike a {% data variables.product.pat_generic %}, a {% data variables.product.prodname_github_app %} is not tied to a user, so the workflow will continue to work even if the user who installed the app leaves your organization. For more information, see [AUTOTITLE](/apps/creating-github-apps/guides/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow).
5036

37+
## Automatically redacted secrets
38+
39+
{% data variables.product.prodname_actions %} automatically redacts the contents of all {% data variables.product.prodname_dotcom %} secrets that are printed to workflow logs.
40+
41+
{% data variables.product.prodname_actions %} also redacts information that is recognized as sensitive, but is not stored as a secret. For a list of automatically redacted secrets, see [AUTOTITLE](/actions/reference/secrets-reference#automatically-redacted-secrets).
42+
43+
> [!NOTE] If you would like other types of sensitive information to be automatically redacted, please reach out to us in our [community discussions](https://github.com/orgs/community/discussions?discussions_q=is%3Aopen+label%3AActions).
44+
45+
As a habit of best practice, you should mask all sensitive information that is not a {% data variables.product.prodname_dotcom %} secret by using `::add-mask::VALUE`. This causes the value to be treated as a secret and redacted from logs. For more information about masking data, see [AUTOTITLE](/actions/using-workflows/workflow-commands-for-github-actions#masking-a-value-in-a-log).
46+
47+
Redacting of secrets is performed by your workflow runners. This means a secret will only be redacted if it was used within a job and is accessible by the runner. If an unredacted secret is sent to a workflow run log, you should delete the log and rotate the secret. For information on deleting logs, see [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs#deleting-logs).
48+
5149
## Further reading
5250

5351
* [AUTOTITLE](/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions)

content/actions/concepts/workflows-and-actions/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can set your own custom variables or use the default environment variables t
2020
You can set a custom variable in two ways.
2121

2222
* To define an environment variable for use in a single workflow, you can use the `env` key in the workflow file. For more information, see [Defining environment variables for a single workflow](/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-environment-variables-for-a-single-workflow).
23-
* To define a configuration variable across multiple workflows, you can define it at the organization, repository, or environment level. For more information, see [Defining configuration variables for multiple workflows](/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-configuration-variables-for-multiple-workflows).
23+
* To define a configuration variable across multiple workflows, you can define it at the organization, repository, or environment level. When creating a variable in an organization, you can use a policy to limit access by repository. For example, you can grant access to all repositories, or limit access to only private repositories or a specified list of repositories. For more information, see [Defining configuration variables for multiple workflows](/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-configuration-variables-for-multiple-workflows).
2424

2525
> [!WARNING]
2626
> By default, variables render unmasked in your build outputs. If you need greater security for sensitive information, such as passwords, use secrets instead. For more information, see [AUTOTITLE](/actions/security-for-github-actions/security-guides/about-secrets).

content/actions/how-tos/security-for-github-actions/security-guides/using-secrets-in-github-actions.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Using secrets in GitHub Actions
33
shortTitle: Using secrets
4-
intro: 'Secrets allow you to store sensitive information in your organization, repository, or repository environments.'
4+
intro: 'Learn how to create secrets at the repository, environment, and organization levels for {% data variables.product.prodname_actions %} workflows.'
55
redirect_from:
66
- /github/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets
77
- /actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets
@@ -19,10 +19,6 @@ versions:
1919
ghec: '*'
2020
---
2121

22-
{% data reusables.actions.enterprise-github-hosted-runners %}
23-
24-
For general information about secrets, see [AUTOTITLE](/actions/security-for-github-actions/security-guides/about-secrets).
25-
2622
## Creating secrets for a repository
2723

2824
{% data reusables.actions.permissions-statement-secrets-variables-repository %}
@@ -45,8 +41,6 @@ If your repository has environment secrets or can access secrets from the parent
4541

4642
{% cli %}
4743

48-
{% data reusables.cli.cli-learn-more %}
49-
5044
To add a repository secret, use the `gh secret set` subcommand. Replace `secret-name` with the name of your secret.
5145

5246
```shell
@@ -172,6 +166,8 @@ You can check which access policies are being applied to a secret in your organi
172166
> * Secrets are not automatically passed to reusable workflows. For more information, see [AUTOTITLE](/actions/using-workflows/reusing-workflows#passing-inputs-and-secrets-to-a-reusable-workflow).
173167
> {% data reusables.actions.about-oidc-short-overview %}
174168
169+
> [!WARNING] Mask all sensitive information that is not a {% data variables.product.prodname_dotcom %} secret by using `::add-mask::VALUE`. This causes the value to be treated as a secret and redacted from logs.
170+
175171
To provide an action with a secret as an input or environment variable, you can use the `secrets` context to access secrets you've created in your repository. For more information, see [AUTOTITLE](/actions/learn-github-actions/contexts) and [AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions).
176172

177173
{% raw %}
@@ -240,19 +236,7 @@ steps:
240236

241237
{% endraw %}
242238

243-
## Limits for secrets
244-
245-
You can store up to 1,000 organization secrets, 100 repository secrets, and 100 environment secrets.
246-
247-
A workflow created in a repository can access the following number of secrets:
248-
249-
* All 100 repository secrets.
250-
* 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).
251-
* All 100 environment secrets.
252-
253-
Secrets are limited to 48 KB in size. To store larger secrets, see the [Storing large secrets](#storing-large-secrets) workaround below.
254-
255-
### Storing large secrets
239+
## Storing large secrets
256240

257241
To use secrets that are larger than 48 KB, you can use a workaround to store 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).
258242

@@ -330,7 +314,8 @@ To use secrets that are larger than 48 KB, you can use a workaround to store sec
330314
You can use Base64 encoding to store small binary blobs as secrets. You can then reference the secret in your workflow and decode it for use on the runner. For the size limits, see [AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions#limits-for-secrets).
331315

332316
> [!NOTE]
333-
> Note that Base64 only converts binary to text, and is not a substitute for actual encryption.
317+
> * Note that Base64 only converts binary to text, and is not a substitute for actual encryption.
318+
> * Using another shell might require different commands for decoding the secret to a file. On Windows runners, we recommend [using a bash shell](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell) with `shell: bash` to use the commands in the `run` step above.
334319

335320
1. Use `base64` to encode your file into a Base64 string. For example:
336321

@@ -374,33 +359,3 @@ You can use Base64 encoding to store small binary blobs as secrets. You can then
374359
run: |
375360
openssl x509 -in cert.der -inform DER -text -noout
376361
```
377-
378-
> [!NOTE]
379-
> Using another shell might require different commands for decoding the secret to a file. On Windows runners, we recommend [using a bash shell](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell) with `shell: bash` to use the commands in the `run` step above.
380-
381-
## Redacting secrets from workflow run logs
382-
383-
{% data variables.product.prodname_actions %} automatically redacts the contents of all {% data variables.product.prodname_dotcom %} secrets that are printed to workflow logs.
384-
385-
{% data variables.product.prodname_actions %} also redacts information that is recognized as sensitive, but is not stored as a secret. Currently {% data variables.product.prodname_dotcom %} supports the following:
386-
387-
* 32-byte and 64-byte Azure keys
388-
* Azure AD client app passwords
389-
* Azure Cache keys
390-
* Azure Container Registry keys
391-
* Azure Function host keys
392-
* Azure Search keys
393-
* Database connection strings
394-
* HTTP Bearer token headers
395-
* JWTs
396-
* NPM author tokens
397-
* NuGet API keys
398-
* v1 GitHub installation tokens
399-
* v2 GitHub installation tokens (`ghp`, `gho`, `ghu`, `ghs`, `ghr`)
400-
* v2 GitHub PATs
401-
402-
> [!NOTE] If you would like other types of sensitive information to be automatically redacted, please reach out to us in our [community discussions](https://github.com/orgs/community/discussions?discussions_q=is%3Aopen+label%3AActions).
403-
404-
As a habit of best practice, you should mask all sensitive information that is not a {% data variables.product.prodname_dotcom %} secret by using `::add-mask::VALUE`. This causes the value to be treated as a secret and redacted from logs. For more information about masking data, see [AUTOTITLE](/actions/using-workflows/workflow-commands-for-github-actions#masking-a-value-in-a-log).
405-
406-
Redacting of secrets is performed by your workflow runners. This means a secret will only be redacted if it was used within a job and is accessible by the runner. If an unredacted secret is sent to a workflow run log, you should delete the log and rotate the secret. For information on deleting logs, see [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs#deleting-logs).

content/actions/reference/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ children:
1111
- /events-that-trigger-workflows
1212
- /workflow-commands-for-github-actions
1313
- /variables-reference
14+
- /secrets-reference
1415
- /evaluate-expressions-in-workflows-and-actions
1516
- /contexts-reference
1617
- /metadata-syntax-reference
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Secrets reference
3+
shortTitle: Secrets reference
4+
intro: 'Find technical information about secrets in {% data variables.product.prodname_actions %}.'
5+
versions:
6+
fpt: '*'
7+
ghec: '*'
8+
ghes: '*'
9+
---
10+
11+
## Naming your secrets
12+
13+
>[!TIP]
14+
> To help ensure that {% data variables.product.prodname_dotcom %} redacts your secrets in logs correctly, avoid using structured data as the values of secrets.
15+
16+
The following rules apply to secret names:
17+
18+
{% data reusables.actions.actions-secrets-and-variables-naming %}
19+
20+
{% data reusables.codespaces.secret-precedence %} Similarly, if an organization, repository, and environment all have a secret with the same name, the environment-level secret takes precedence.
21+
22+
## Limits for secrets
23+
24+
You can store up to 1,000 organization secrets, 100 repository secrets, and 100 environment secrets.
25+
26+
A workflow created in a repository can access the following number of secrets:
27+
28+
* All 100 repository secrets.
29+
* 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).
30+
* All 100 environment secrets.
31+
32+
Secrets are limited to 48 KB in size. To store larger secrets, see [AUTOTITLE](/actions/how-tos/security-for-github-actions/security-guides/using-secrets-in-github-actions#storing-large-secrets).
33+
34+
## When {% data variables.product.prodname_actions %} reads secrets
35+
36+
Organization and repository secrets are read when a workflow run is queued, and environment secrets are read when a job referencing the environment starts.
37+
38+
## Automatically redacted secrets
39+
40+
{% data variables.product.prodname_dotcom %} automatically redacts the following sensitive information from workflow logs.
41+
42+
* 32-byte and 64-byte Azure keys
43+
* Azure AD client app passwords
44+
* Azure Cache keys
45+
* Azure Container Registry keys
46+
* Azure Function host keys
47+
* Azure Search keys
48+
* Database connection strings
49+
* HTTP Bearer token headers
50+
* JWTs
51+
* NPM author tokens
52+
* NuGet API keys
53+
* v1 GitHub installation tokens
54+
* v2 GitHub installation tokens (`ghp`, `gho`, `ghu`, `ghs`, `ghr`)
55+
* v2 GitHub PATs

content/copilot/concepts/copilot-billing/understanding-and-managing-requests-in-copilot.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,13 @@ If you use **{% data variables.copilot.copilot_free_short %}**, you have access
9292
|-------------------------------------------------------------------------|--------------------------------|-----------------------|
9393
| {% data variables.copilot.copilot_gpt_41 %} | 0 | 1 |
9494
| {% data variables.copilot.copilot_gpt_4o %} | 0 | 1 |
95-
| {% data variables.copilot.copilot_gpt_45 %} | 50 | Not applicable |
9695
| {% data variables.copilot.copilot_claude_sonnet_35 %} | 1 | 1 |
9796
| {% data variables.copilot.copilot_claude_sonnet_37 %} | 1 | Not applicable |
9897
| {% data variables.copilot.copilot_claude_sonnet_37 %} Thinking | 1.25 | Not applicable |
9998
| {% data variables.copilot.copilot_claude_sonnet_40 %} | 1 | Not applicable |
10099
| {% data variables.copilot.copilot_claude_opus %} | 10 | Not applicable |
101100
| {% data variables.copilot.copilot_gemini_flash %} | 0.25 | 1 |
102101
| {% data variables.copilot.copilot_gemini_25_pro %} | 1 | Not applicable |
103-
| {% data variables.copilot.copilot_o1 %} | 10 | Not applicable |
104102
| {% data variables.copilot.copilot_o3 %} | 1 | Not applicable |
105103
| {% data variables.copilot.copilot_o3_mini %} | 0.33 | 1 |
106104
| {% data variables.copilot.copilot_o4_mini %} | 0.33 | Not applicable |
@@ -111,6 +109,6 @@ If you use **{% data variables.copilot.copilot_free_short %}**, you have access
111109

112110
Premium request usage is based on the model’s multiplier and the feature you’re using. For example:
113111

114-
* **Using {% data variables.copilot.copilot_gpt_45 %} in {% data variables.copilot.copilot_chat_short %}**: With a 50× multiplier, one interaction counts as 50 premium requests.
112+
* **Using {% data variables.copilot.copilot_claude_opus %} in {% data variables.copilot.copilot_chat_short %}**: With a 10× multiplier, one interaction counts as 10 premium requests.
115113
* **Using {% data variables.copilot.copilot_gpt_41 %} on {% data variables.copilot.copilot_free_short %}**: Each interaction counts as 1 premium request.
116114
* **Using {% data variables.copilot.copilot_gpt_41 %} on a paid plan**: No premium requests are consumed.

0 commit comments

Comments
 (0)