Skip to content

Commit 4afc7d4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into default-platform
2 parents 51b8176 + b0f9200 commit 4afc7d4

44 files changed

Lines changed: 513 additions & 139 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Confirm internal staff meant to post in public
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
- reopened
8+
- transferred
9+
pull_request_target:
10+
types:
11+
- opened
12+
- reopened
13+
14+
jobs:
15+
check-team-membership:
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
if: github.repository == 'github/docs'
19+
steps:
20+
- id: membership_check
21+
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
22+
with:
23+
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
24+
script: |
25+
// Only perform this action with GitHub employees
26+
try {
27+
await github.teams.getMembershipForUserInOrg({
28+
org: 'github',
29+
team_slug: 'employees',
30+
username: context.payload.sender.login,
31+
});
32+
} catch(err) {
33+
// An error will be thrown if the user is not a GitHub employee
34+
// If a user is not a GitHub employee, we should stop here and
35+
// Not send a notification
36+
return
37+
}
38+
39+
// Don't perform this action with Docs team members
40+
try {
41+
await github.teams.getMembershipForUserInOrg({
42+
org: 'github',
43+
team_slug: 'docs',
44+
username: context.payload.sender.login,
45+
});
46+
// If the user is a Docs team member, we should stop here and not send
47+
// a notification
48+
return
49+
} catch(err) {
50+
// An error will be thrown if the user is not a Docs team member
51+
// If a user is not a Docs team member we should continue and send
52+
// the notification
53+
}
54+
55+
const issueNo = context.number || context.issue.number
56+
57+
// Create an issue in our private repo
58+
await github.issues.create({
59+
owner: 'github',
60+
repo: 'docs-internal',
61+
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
62+
body: `@${context.payload.sender.login} opened https://github.com/github/docs/issues/${issueNo} publicly in the github/docs repo, instead of the private github/docs-internal repo.\n\n@${context.payload.sender.login}, please confirm that this belongs in the public repo and that no sensitive information was disclosed by commenting below and closing the issue.\n\nIf this was not intentional and sensitive information was shared, please delete https://github.com/github/docs/issues/${issueNo} and notify us in the \#docs-open-source channel.\n\nThanks! \n\n/cc @github/docs @github/docs-engineering`
63+
});
64+
65+
core.setOutput('did_warn', 'true')
66+
67+
- name: Send Slack notification if a GitHub employee who isn't on the docs team opens an issue in public
68+
if: ${{ steps.membership_check.outputs.did_warn && github.repository == 'github/docs' }}
69+
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
70+
with:
71+
channel: ${{ secrets.DOCS_OPEN_SOURCE_SLACK_CHANNEL_ID }}
72+
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
73+
text: <@${{github.actor}}> opened https://github.com/github/docs/issues/${{ github.event.number || github.event.issue.number }} publicly on the github/docs repo instead of the private github/docs-internal repo. They have been notified via a new issue in the github/docs-internal repo to confirm this was intentional.

.github/workflows/repo-sync-stalls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Repo Sync Stalls
22
on:
33
workflow_dispatch:
44
schedule:
5-
- cron: '*/30 * * * *'
5+
- cron: '0 */2 * * *'
66
jobs:
77
check-freezer:
88
name: Check for deployment freezes

.github/workflows/repo-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
destination_branch: main
5353
pr_title: 'repo sync'
5454
pr_body: "This is an automated pull request to sync changes between the public and private repos.\n\n:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!"
55-
pr_label: automerge,autoupdate
55+
pr_label: automerge,autoupdate,automated-reposync-pr
5656
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
5757

5858
- name: Find pull request

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "attach",
7+
"name": "Node: Nodemon",
8+
"processId": "${command:PickProcess}",
9+
"restart": true,
10+
"protocol": "inspector",
11+
},
12+
]
13+
}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ There are a few more things to know when you're getting started with this repo:
5050
In addition to the README you're reading right now, this repo includes other READMEs that describe the purpose of each subdirectory in more detail:
5151

5252
- [content/README.md](content/README.md)
53+
- [content/graphql/README.md](content/graphql/README.md)
54+
- [content/rest/README.md](content/rest/README.md)
5355
- [contributing/README.md](contributing/README.md)
5456
- [data/README.md](data/README.md)
5557
- [data/reusables/README.md](data/reusables/README.md)

content/actions/learn-github-actions/security-hardening-for-github-actions.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ This means that a compromise of a single action within a workflow can be very si
5454
**Warning:** The short version of the commit SHA is insecure and should never be used for specifying an action's Git reference. Because of how repository networks work, any user can fork the repository and push a crafted commit to it that collides with the short SHA. This causes subsequent clones at that SHA to fail because it becomes an ambiguous commit. As a result, any workflows that use the shortened SHA will immediately fail.
5555

5656
{% endwarning %}
57+
58+
5759
* **Audit the source code of the action**
5860

5961
Ensure that the action is handling the content of your repository and secrets as expected. For example, check that secrets are not sent to unintended hosts, or are not inadvertently logged.
@@ -92,10 +94,14 @@ This list describes the recommended approaches for accessing repository data wit
9294

9395
As a result, self-hosted runners should almost [never be used for public repositories](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories) on {% data variables.product.product_name %}, because any user can open pull requests against the repository and compromise the environment. Similarly, be cautious when using self-hosted runners on private repositories, as anyone who can fork the repository and open a PR (generally those with read-access to the repository) are able to compromise the self-hosted runner environment, including gaining access to secrets and the more privileged `GITHUB_TOKEN` which grants write-access permissions on the repository.
9496

97+
When a self-hosted runner is defined at the organization or enterprise level, {% data variables.product.product_name %} can schedule workflows from multiple repositories onto the same runner. Consequently, a security compromise of these environments can result in a wide impact. To help reduce the scope of a compromise, you can create boundaries by organizing your self-hosted runners into separate groups. For more information, see "[Managing access to self-hosted runners using groups](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups)."
98+
9599
You should also consider the environment of the self-hosted runner machines:
96100
- What sensitive information resides on the machine configured as a self-hosted runner? For example, private SSH keys, API access tokens, among others.
97101
- Does the machine have network access to sensitive services? For example, Azure or AWS metadata services. The amount of sensitive information in this environment should be kept to a minimum, and you should always be mindful that any user capable of invoking workflows has access to this environment.
98102

103+
Some customers might attempt to partially mitigate these risks by implementing systems that automatically destroy the self-hosted runner after each job execution. However, this approach might not be as effective as intended, as there is no way to guarantee that a self-hosted runner only runs one job.
104+
99105
### Auditing {% data variables.product.prodname_actions %} events
100106

101107
You can use the audit log to monitor administrative tasks in an organization. The audit log records the type of action, when it was run, and which user account performed the action.
@@ -132,5 +138,3 @@ The following tables describe the {% data variables.product.prodname_actions %}
132138
| `action:org.runner_group_renamed` | Triggered when an organization admin renames a self-hosted runner group.
133139
| `action:org.runner_group_runners_added` | Triggered when an organization admin [adds a self-hosted runner to a group](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups#moving-a-self-hosted-runner-to-a-group).
134140
| `action:org.runner_group_runners_removed` | Triggered when an organization admin removes a self-hosted runner from a group.
135-
136-

content/developers/webhooks-and-events/webhook-events-and-payloads.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ Key | Type | Description
445445
#### Webhook payload object
446446
447447
{% data reusables.webhooks.installation_properties %}
448-
{% data reusables.webhooks.app_desc %}
448+
{% data reusables.webhooks.app_always_desc %}
449449
{% data reusables.webhooks.sender_desc %}
450450
451451
#### Webhook payload example
@@ -469,7 +469,7 @@ Key | Type | Description
469469
#### Webhook payload object
470470
471471
{% data reusables.webhooks.installation_repositories_properties %}
472-
{% data reusables.webhooks.app_desc %}
472+
{% data reusables.webhooks.app_always_desc %}
473473
{% data reusables.webhooks.sender_desc %}
474474
475475
#### Webhook payload example

content/discussions/guides/finding-discussions-across-multiple-repositories.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ versions:
1010
### Finding discussions
1111

1212
1. Navigate to {% data variables.product.prodname_dotcom_the_website %}.
13-
1. In the top-right corner of {% data variables.product.prodname_dotcom_the_website %}, click your profile photo, then click **Your enterprises**.
13+
1. In the top-right corner of {% data variables.product.prodname_dotcom_the_website %}, click your profile photo, then click **Your discussions**.
1414
!["Your discussions" in drop-down menu for profile photo on {% data variables.product.product_name %}](/assets/images/help/discussions/your-discussions.png)
1515
1. Toggle between **Created** and **Commented** to see the discussions you've created or participated in.
1616

content/github/creating-cloning-and-archiving-repositories/about-code-owners.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ For code owners to receive review requests, the CODEOWNERS file must be on the b
3939

4040
### CODEOWNERS syntax
4141

42-
A CODEOWNERS file uses a pattern that follows the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files. The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`.
42+
A CODEOWNERS file uses a pattern that follows most of the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files, with [some exceptions](#syntax-exceptions). The pattern is followed by one or more {% data variables.product.prodname_dotcom %} usernames or team names using the standard `@username` or `@org/team-name` format. You can also refer to a user by an email address that has been added to their {% data variables.product.product_name %} account, for example `user@example.com`.
4343

44-
If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews. Invalid syntax includes inline comments and user or team names that do not exist on {% data variables.product.product_name %}.
44+
If any line in your CODEOWNERS file contains invalid syntax, the file will not be detected and will not be used to request reviews.
4545
#### Example of a CODEOWNERS file
4646
```
4747
# This is a comment.
@@ -83,6 +83,13 @@ apps/ @octocat
8383
# subdirectories.
8484
/docs/ @doctocat
8585
```
86+
#### Syntax exceptions
87+
There are some syntax rules for gitignore files that do not work in CODEOWNERS files:
88+
- Escaping a pattern starting with `#` using `\` so it is treated as a pattern and not a comment
89+
- Using `!` to negate a pattern
90+
- Using `[ ]` to define a character range
91+
92+
8693

8794
### Further reading
8895

content/github/getting-started-with-github/github-glossary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ versions:
1010
---
1111

1212
{% for term in site.data.glossaries.external %}
13-
### {{term.term}}
14-
{{term.description}}
13+
### {% data glossaries.external[forloop.index0].term %}
14+
{% data glossaries.external[forloop.index0].description %}
1515
---
1616
{% endfor %}
1717

0 commit comments

Comments
 (0)