Skip to content

Commit d4b11ec

Browse files
authored
Merge pull request github#36653 from github/repo-sync
Repo sync
2 parents 234288a + f92c0f2 commit d4b11ec

File tree

43 files changed

+182
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+182
-141
lines changed

.github/workflows/close-on-invalid-label.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ permissions:
1818
pull-requests: write
1919

2020
jobs:
21-
close-on-adding-invalid-label:
22-
if: github.repository == 'github/docs' && github.event.label.name == 'invalid'
21+
close-if-invalid:
22+
if: github.repository == 'github/docs' && (github.event.label.name == 'invalid' || github.event.pull_request.title == 'Revert "Repo sync"')
2323
runs-on: ubuntu-latest
2424

2525
steps:

.github/workflows/codespace-review-check.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ jobs:
3232
LOGIN: docs-bot
3333
REPO: github/docs-internal
3434
run: |
35-
ago=$(date -d '225 minutes ago' -Iseconds)
35+
# If its approaching 4 hours, update the comment
36+
# But don't keep trying to update the comment after 5 hours cause that wastes API calls
37+
from=$(date -d '285 minutes ago' -Iseconds) # 5 * 60 - 15 = 285
38+
until=$(date -d '225 minutes ago' -Iseconds) # 4 * 60 - 15 = 225
3639
echo "- Ago: $ago"
3740
# on mac: date -v-225M -Iseconds
38-
# -v-225M means 225 minutes ago, 4 * 60 - 15 = 225
3941
# -Iseconds means ISO 8601 format, to seconds
4042
branches=$(
4143
gh codespace list \
4244
--repo "$REPO" \
4345
--limit 1000 \
4446
--json name,owner,lastUsedAt,gitStatus \
45-
--jq ".[] | select(.owner == \"$LOGIN\" and .lastUsedAt < \"$ago\") | .gitStatus.ref" \
47+
--jq ".[] | select(.owner == \"$LOGIN\" and .lastUsedAt < \"$until\" and .lastUsedAt > \"$from\") | .gitStatus.ref" \
4648
)
4749
echo "- Branches:"
4850
echo "$(echo "$branches" | sed 's/^/ /')"
@@ -111,14 +113,14 @@ jobs:
111113
112114
### Review this PR in a codespace 📦
113115
114-
Your codespace is no longer active.
116+
The codespace is no longer active.
115117
You’ve reached the 4 hour limit.
116-
In order to reactivate your codespace, please update your pull request by adding the https://github.com/${{ env.REPO }}/labels/extend-codespace label.
117-
If the label is already applied, you can remove and reapply the label to reactivate your codespace.
118+
In order to reactivate the codespace, please update the pull request by adding the https://github.com/${{ env.REPO }}/labels/extend-codespace label.
119+
If the label is already applied, you can remove and reapply the label to reactivate the codespace.
118120
119121
🤖 This comment is [automatically generated][workflow].
120122
121-
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/codespace-review-check.yml
123+
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.workflow_sha }}/.github/workflows/codespace-review-check.yml
122124
123125
- uses: ./.github/actions/slack-alert
124126
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}

.github/workflows/codespace-review-down.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ jobs:
7777
7878
### Review this PR in a codespace 📦
7979
80-
Your pull request is now merged or closed, so I've removed all automatically created codespaces.
80+
The pull request is now merged or closed, so I've removed all automatically created codespaces.
8181
8282
🤖 This comment is [automatically generated][workflow].
8383
84-
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/codespace-review-down.yml
84+
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.workflow_sha }}/.github/workflows/codespace-review-down.yml

.github/workflows/codespace-review-up.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
gh pr comment \
108108
"$branch" \
109109
--repo "$REPO" \
110-
--body "Thank you for your pull request. I deleted the oldest codespaces to make room for a new one. You can make a new codespace by updating your pull request or closing and reopening your pull request."
110+
--body "Thank you for this pull request. I deleted the oldest codespaces to make room for a new one. You can make a new codespace by updating the pull request or closing and reopening the pull request."
111111
echo "Commented on branch $branch"
112112
done
113113
echo "Deleted the oldest $tocut codespaces"
@@ -205,18 +205,18 @@ jobs:
205205
206206
### Review this PR in a codespace 📦
207207
208-
Your codespace will be ready in two to three minutes and you can review changes at:
208+
The codespace will be ready in two to three minutes and you can review changes at:
209209
${{ env.APP_URL }}
210-
Your codespace will be automatically deleted once your pull request is closed or merged.
210+
The codespace will be automatically deleted once the pull request is closed or merged.
211211
212-
#### Your codespace will idle after 4 hours of inactivity
212+
#### The codespace will idle after 4 hours of inactivity
213213
214-
After 4 hours, you can reactivate your codespace by applying the https://github.com/${{ env.REPO }}/labels/extend-codespace label to the pull request.
215-
If the label is already applied, you can remove and reapply the label to reactivate your codespace.
214+
After 4 hours, you can reactivate the codespace by applying the https://github.com/${{ env.REPO }}/labels/extend-codespace label to the pull request.
215+
If the label is already applied, you can remove and reapply the label to reactivate the codespace.
216216
217217
<details><summary>Table of review links</summary>
218218
219-
${{ steps.changes.outputs.changesTable && 'The table shows the files in the `content` directory that were changed in this pull request. This helps you review your changes on the review server. Changes to the `data` directory are not included in this table.' || '' }}
219+
${{ steps.changes.outputs.changesTable && 'The table shows the files in the `content` directory that were changed in this pull request. Changes to the `data` directory are not included in this table.' || '' }}
220220
221221
${{ steps.changes.outputs.changesTable || '_This pull request contains code changes, so we will not generate a table of review links._' }}
222222
@@ -226,4 +226,4 @@ jobs:
226226
227227
🤖 This comment is [automatically generated][workflow].
228228
229-
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/codespace-review-up.yml
229+
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.workflow_sha }}/.github/workflows/codespace-review-up.yml

.github/workflows/review-comment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ jobs:
100100
101101
🤖 This comment is [automatically generated][workflow].
102102
103-
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/review-comment.yml
103+
[workflow]: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.workflow_sha }}/.github/workflows/review-comment.yml
104104
[codespace]: ${{ github.repository == 'github/docs-internal' && 'https://github.com/github/docs-team/blob/main/contributing-to-docs/use-a-codespace-to-review.md' || 'https://docs.github.com/en/contributing/setting-up-your-environment-to-work-on-github-docs/working-on-github-docs-in-a-codespace' }}
105105
[local]: https://docs.github.com/en/contributing/setting-up-your-environment-to-work-on-github-docs/creating-a-local-environment#setting-up-your-local-environment

content/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Once custom deployment protection rules have been created and installed on a rep
126126

127127
## Environment secrets
128128

129-
Secrets stored in an environment are only available to workflow jobs that reference the environment. If the environment requires approval, a job cannot access environment secrets until one of the required reviewers approves it. For more information about secrets, see [AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions).
129+
Secrets stored in an environment are only available to workflow jobs that reference the environment. If the environment requires approval, a job cannot access environment secrets until one of the required reviewers approves it. For more information about secrets, see [AUTOTITLE](/actions/security-for-github-actions/security-guides/about-secrets).
130130

131131
{% ifversion fpt %}
132132
> [!NOTE]

content/actions/migrating-to-github-actions/manually-migrating-to-github-actions/migrating-from-gitlab-cicd-to-github-actions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ For more information, see [AUTOTITLE](/actions/using-workflows/events-that-trigg
264264

265265
GitLab CI/CD and {% data variables.product.prodname_actions %} support setting variables in the pipeline or workflow configuration file, and creating secrets using the GitLab or {% data variables.product.github %} UI.
266266

267-
For more information, see [AUTOTITLE](/actions/learn-github-actions/variables) and [AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions).
267+
For more information, see [AUTOTITLE](/actions/learn-github-actions/variables) and [AUTOTITLE](/actions/security-for-github-actions/security-guides/about-secrets).
268268

269269
## Caching
270270

content/actions/migrating-to-github-actions/manually-migrating-to-github-actions/migrating-from-travis-ci-to-github-actions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ When migrating from Travis CI, consider the following key features in {% data va
163163

164164
### Storing secrets
165165

166-
{% data variables.product.prodname_actions %} allows you to store secrets and reference them in your jobs. {% data variables.product.prodname_actions %} organizations can limit which repositories can access organization secrets. Deployment protection rules can require manual approval for a workflow to access environment secrets. For more information, see [AUTOTITLE](/actions/security-guides/using-secrets-in-github-actions).
166+
{% data variables.product.prodname_actions %} allows you to store secrets and reference them in your jobs. {% data variables.product.prodname_actions %} organizations can limit which repositories can access organization secrets. Deployment protection rules can require manual approval for a workflow to access environment secrets. For more information, see [AUTOTITLE](/actions/security-for-github-actions/security-guides/about-secrets).
167167

168168
### Sharing files between jobs and workflows
169169

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: About secrets
3+
intro: 'Learn about secrets as they''re used in GitHub Actions.'
4+
versions:
5+
fpt: '*'
6+
ghes: '*'
7+
ghec: '*'
8+
---
9+
10+
{% data reusables.actions.enterprise-github-hosted-runners %}
11+
12+
## About secrets
13+
14+
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.
15+
16+
{% data variables.product.prodname_actions %} can only read a secret if you explicitly include the secret in a workflow.
17+
18+
## Naming your secrets
19+
20+
>[!TIP]
21+
> To help ensure that {% data variables.product.prodname_dotcom %} redacts your secrets in logs correctly, avoid using structured data as the values of secrets.
22+
23+
The following rules apply to secret names:
24+
25+
{% data reusables.actions.actions-secrets-and-variables-naming %}
26+
27+
{% 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.
28+
29+
## Using your secrets in workflows
30+
31+
{% data reusables.actions.secrets-redaction-warning %}
32+
33+
{% data reusables.actions.secrets-org-level-overview %}
34+
35+
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.
36+
37+
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).
38+
39+
Organization and repository secrets are read when a workflow run is queued, and environment secrets are read when a job referencing the environment starts.
40+
41+
## Limiting credential permissions
42+
43+
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.
44+
45+
When generating a {% data variables.product.pat_v1 %}, select the fewest scopes necessary. When generating a {% data variables.product.pat_v2 %}, select the minimum permissions and repository access required.
46+
47+
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).
48+
49+
## Further reading
50+
51+
* [AUTOTITLE](/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions)
52+
* [AUTOTITLE](/rest/actions/secrets)

content/actions/security-for-github-actions/security-guides/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ versions:
88
ghec: '*'
99
children:
1010
- /security-hardening-for-github-actions
11+
- /about-secrets
1112
- /using-secrets-in-github-actions
1213
- /automatic-token-authentication
1314
- /using-githubs-security-features-to-secure-your-use-of-github-actions

content/actions/security-for-github-actions/security-guides/using-githubs-security-features-to-secure-your-use-of-github-actions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ For information on how to configure {% data variables.product.prodname_dependabo
8080

8181
## Protecting actions you've created
8282

83-
{% data variables.product.prodname_dotcom %} enables collaboration between people who publish and maintain actions and vulnerability reporters in order to promote code security. {% data reusables.security-advisory.security-advisory-overview %}
83+
{% data variables.product.prodname_dotcom %} enables collaboration between people who publish and maintain actions and vulnerability reporters in order to promote secure coding. {% data reusables.security-advisory.security-advisory-overview %}
8484

8585
If you are someone who maintains an action that is used in other projects, you can use the following {% data variables.product.prodname_dotcom %} features to enhance the security of the actions you've published.
8686

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

+2-45
Original file line numberDiff line numberDiff line change
@@ -19,51 +19,7 @@ versions:
1919

2020
{% data reusables.actions.enterprise-github-hosted-runners %}
2121

22-
## About secrets
23-
24-
Secrets are variables that you create in an organization, repository, or repository environment. The secrets that you create are available to use in {% data variables.product.prodname_actions %} workflows. {% data variables.product.prodname_actions %} can only read a secret if you explicitly include the secret in a workflow.
25-
26-
{% data reusables.actions.secrets-org-level-overview %}
27-
28-
For secrets stored at the environment level, 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.
29-
30-
> [!NOTE]
31-
> {% data reusables.actions.about-oidc-short-overview %}
32-
33-
### Naming your secrets
34-
35-
The following rules apply to secret names:
36-
37-
{% data reusables.actions.actions-secrets-and-variables-naming %}
38-
39-
For example, a secret created at the environment level must have a unique name in that environment, a secret created at the repository level must have a unique name in that repository, and a secret created at the organization level must have a unique name at that level.
40-
41-
{% 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.
42-
43-
To help ensure that {% data variables.product.prodname_dotcom %} redacts your secrets in logs correctly, avoid using structured data as the values of secrets. For example, avoid creating secrets that contain JSON or encoded Git blobs. Using structured data as secrets could cause non-secrets to be detected as such, making passing data between workflows harder to implement. In such cases, consider manipulating the structured data, for example encoding them to a string, before storing them as secrets, and decoding them before they are used.
44-
45-
### Accessing your secrets
46-
47-
To make a secret available to an action, you must set the secret as an input or environment variable in the workflow file. Review the action's README file to learn about which inputs and environment variables the action expects. For more information, see [AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv).
48-
49-
You can use and read secrets in a workflow file if you have access to edit the file. For more information, see [AUTOTITLE](/get-started/learning-about-github/access-permissions-on-github).
50-
51-
{% data reusables.actions.secrets-redaction-warning %}
52-
53-
Organization and repository secrets are read when a workflow run is queued, and environment secrets are read when a job referencing the environment starts.
54-
55-
You can also manage secrets using the REST API. For more information, see [AUTOTITLE](/rest/actions/secrets).
56-
57-
### Limiting credential permissions
58-
59-
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.
60-
61-
When generating a {% data variables.product.pat_v1 %}, select the fewest scopes necessary. When generating a {% data variables.product.pat_v2 %}, select the minimum permissions and repository access required.
62-
63-
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).
64-
65-
> [!NOTE]
66-
> Users with collaborator access to a repository can use the REST API to manage secrets for that repository, and users with admin access to an organization can use the REST API to manage secrets for that organization. For more information, see [AUTOTITLE](/rest/actions/secrets).
22+
For general information about secrets, see [AUTOTITLE](/actions/security-for-github-actions/security-guides/about-secrets).
6723

6824
## Creating secrets for a repository
6925

@@ -212,6 +168,7 @@ You can check which access policies are being applied to a secret in your organi
212168
> [!NOTE]
213169
> * {% data reusables.actions.forked-secrets %}
214170
> * 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).
171+
> {% data reusables.actions.about-oidc-short-overview %}
215172
216173
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).
217174

0 commit comments

Comments
 (0)