Skip to content

Commit d414066

Browse files
authored
Merge branch 'main' into update-dates-script
2 parents e0c929c + 14046bb commit d414066

35 files changed

Lines changed: 438 additions & 24 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: autoupdate reposync branch on cron
2+
on:
3+
schedule:
4+
- cron: '*/5 * * * *'
5+
jobs:
6+
autoupdate:
7+
name: autoupdate
8+
runs-on: ubuntu-18.04
9+
steps:
10+
- uses: docker://chinthakagodawita/autoupdate-action:v1
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
13+
PR_FILTER: labelled
14+
PR_LABELS: 'automated-reposync-pr'
15+
MERGE_MSG: "Branch was updated using the 'autoupdate reposync branch on cron' Actions workflow."
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
21+
with:
22+
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
23+
script: |
24+
// Only perform this action with GitHub employees
25+
try {
26+
await github.teams.getMembershipForUserInOrg({
27+
org: 'github',
28+
team_slug: 'employees',
29+
username: context.payload.sender.login,
30+
});
31+
} catch(err) {
32+
// An error will be thrown if the user is not a GitHub employee
33+
// If a user is not a GitHub employee, we should stop here and
34+
// Not send a notification
35+
return
36+
}
37+
38+
// Don't perform this action with Docs team members
39+
try {
40+
await github.teams.getMembershipForUserInOrg({
41+
org: 'github',
42+
team_slug: 'docs',
43+
username: context.payload.sender.login,
44+
});
45+
// If the user is a Docs team member, we should stop here and not send
46+
// a notification
47+
return
48+
} catch(err) {
49+
// An error will be thrown if the user is not a Docs team member
50+
// If a user is not a Docs team member we should continue and send
51+
// the notification
52+
}
53+
54+
const issueNo = context.number || context.issue.number
55+
56+
// Create an issue in our private repo
57+
await github.issues.create({
58+
owner: 'github',
59+
repo: 'docs-internal',
60+
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
61+
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`
62+
});
63+
64+
throw new Error('A Hubber opened an issue on the public github/docs repo');
65+
66+
- name: Send Slack notification if a GitHub employee who isn't on the docs team opens an issue in public
67+
if: ${{ failure() && github.repository == 'github/docs' }}
68+
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
69+
with:
70+
channel: ${{ secrets.DOCS_OPEN_SOURCE_SLACK_CHANNEL_ID }}
71+
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
72+
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/graphql/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# GraphQL
2+
3+
The `/content/graphql` directory is where the GitHub GraphQL API docs live!
4+
5+
* The `/content/graphql/guides` and `/content/graphql/overview` directories contain articles that are human-editable.
6+
* The `/content/graphql/reference` directory contains an article for each GraphQL data type used in the GitHub GraphQL API. Most of the content in this directory is rendered using `include` tags.
7+
8+
The content rendered by `include` tags is sourced from the `/lib/graphql/static` directory, which is automatically generated from the API source code internally in GitHub, and should not be edited by a human. For more information, see the [`/lib/graphql/README.md`](/lib/graphql/README.md).
9+
10+
**As a result, we cannot accept contributions to GraphQL API reference content in this repository.**

content/graphql/overview/explorer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ versions:
77
free-pro-team: '*'
88
enterprise-server: '*'
99
github-ae: '*'
10+
layout: graphql-explorer
1011
---
1112

12-
You can access GitHub's GraphQL Explorer at https://developer.github.com/v4/explorer.

0 commit comments

Comments
 (0)