Skip to content

Commit c3177be

Browse files
authored
Merge branch 'main' into automatic-toc
2 parents 5cfb7de + d178a89 commit c3177be

531 files changed

Lines changed: 53478 additions & 20411 deletions

File tree

Some content is hidden

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

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Copy to REST API issue to docs-content
2+
3+
# **What it does**: Copies an issue in the open source repo to the docs-content repo, comments on and closes the original issue
4+
# **Why we have it**: REST API updates cannot be made in the open source repo. Instead, we copy the issue to an internal issue (we do not transfer so that the issue does not disappear for the contributor) and close the original issue.
5+
# **Who does it impact**: Open source and docs-content maintainers
6+
7+
on:
8+
issues:
9+
types:
10+
- labeled
11+
12+
jobs:
13+
transfer-issue:
14+
name: Transfer issue
15+
runs-on: ubuntu-latest
16+
if: github.event.label.name == 'rest-description' && github.repository == 'github/docs'
17+
steps:
18+
- name: Check if this run was triggered by a member of the docs team
19+
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
20+
id: triggered-by-member
21+
with:
22+
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
23+
result-encoding: string
24+
script: |
25+
const triggerer_login = context.payload.sender.login
26+
const teamMembers = await github.request(
27+
`/orgs/github/teams/docs/members?per_page=100`
28+
)
29+
const logins = teamMembers.data.map(member => member.login)
30+
if (logins.includes(triggerer_login)) {
31+
console.log(`This workflow was triggered by ${triggerer_login} (on the docs team).`)
32+
return 'true'
33+
}
34+
console.log(`This workflow was triggered by ${triggerer_login} (not on the docs team), so no action will be taken.`)
35+
return 'false'
36+
37+
- name: Exit if not triggered by a docs team member
38+
if: steps.triggered-by-member.outputs.result == 'false'
39+
run: |
40+
echo Aborting. This workflow must be triggered by a member of the docs team.
41+
exit 1
42+
43+
- name: Create an issue in the docs-content repo
44+
run: |
45+
new_issue_url="$(gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --repo github/docs-content)"
46+
echo 'NEW_ISSUE='$new_issue_url >> $GITHUB_ENV
47+
env:
48+
GITHUB_TOKEN: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
49+
ISSUE_TITLE: ${{ github.event.issue.title }}
50+
ISSUE_BODY: ${{ github.event.issue.body }}
51+
52+
- name: Comment on the new issue
53+
run: gh issue comment $NEW_ISSUE --body "This issue was originally opened in the open source repo as $OLD_ISSUE"
54+
env:
55+
GITHUB_TOKEN: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
56+
NEW_ISSUE: ${{ env.NEW_ISSUE }}
57+
OLD_ISSUE: ${{ github.event.issue.html_url }}
58+
59+
- name: Comment on the old issue
60+
run: gh issue comment $OLD_ISSUE --body "Thank you for opening this issue! Updates to the REST API description must be made internally. I have copied your issue to an internal issue, so I will close this issue."
61+
env:
62+
GITHUB_TOKEN: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
63+
OLD_ISSUE: ${{ github.event.issue.html_url }}
64+
65+
- name: Close the old issue
66+
run: gh issue close $OLD_ISSUE
67+
env:
68+
GITHUB_TOKEN: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
69+
OLD_ISSUE: ${{ github.event.issue.html_url }}

.github/workflows/move-ready-to-merge-issues.yaml renamed to .github/workflows/move-ready-to-merge-pr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: Move and unlabel ready to merge issues
1+
name: Move and unlabel ready to merge PRs
22

3-
# **What it does**: This moves ready to merge issues on the project board for the open source repo. When an issue in the open source repo is labeled "ready to merge," the "waiting for review" label is removed and the issue is moved to the "Triage" column.
4-
# **Why we have it**: To help with managing our project boards.
3+
# **What it does**: When a PR in the open source repo is labeled "ready to merge," the "waiting for review" label is removed and the PR is moved to the "Triage" column.
4+
# **Why we have it**: To help with managing our project boards.
55
# **Who does it impact**: Open source contributors, open-source maintainers.
66

77
on:
@@ -14,7 +14,7 @@ jobs:
1414
if: github.repository == 'github/docs' && github.event.label.name == 'ready to merge'
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: move issue
17+
- name: move PR
1818
uses: alex-page/github-project-automation-plus@fdb7991b72040d611e1123d2b75ff10eda9372c9
1919
with:
2020
project: Docs team reviews

.github/workflows/no-response.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name: No Response
99

1010
on:
1111
issue_comment:
12-
types: created
12+
types: [created]
1313

1414
schedule:
1515
# Schedule for five minutes after the hour every hour
@@ -27,4 +27,6 @@ jobs:
2727
to our request for more information from the original author. With only the
2828
information that is currently in the issue, we don't have enough information
2929
to take action. Please reach out if you have or find the answers we need so
30-
that we can investigate further. See [this blog post on bug reports and the importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/) for more information about the kind of information that may be helpful.
30+
that we can investigate further. See [this blog post on bug reports and the
31+
importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/)
32+
for more information about the kind of information that may be helpful.

.github/workflows/site-policy-sync.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: site-policy-sync
22

3-
# **What it does**: Updates our site policy docs when changes happen to site policy.
4-
# **Why we have it**: We want up to date site policy docs.
5-
# **Who does it impact**: Site policy team.
3+
# **What it does**: Updates our site-policy repo when changes happen to site policy docs.
4+
# **Why we have it**: We want keep site-policy repo up to date.
5+
# **Who does it impact**: Site-policy team.
66

77
# Controls when the action will run.
88
on:
@@ -30,6 +30,10 @@ jobs:
3030
steps:
3131
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3232
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
33+
# Sets commit message
34+
- name: custom message
35+
run: |
36+
echo "MESSAGE=${{github.event.pull_request.title}}" >> $GITHUB_ENV
3337
3438
# Pushes to other repo
3539
- name: Push folder to another repository
@@ -42,6 +46,6 @@ jobs:
4246
destination_branch: 'main'
4347
destination_branch_create: 'repo-sync'
4448
destination_folder: 'Policies'
45-
user_email: 'pcihon@users.noreply.github.com'
46-
user_name: 'pcihon'
47-
commit_msg: 'Automatic sync from GitHub Docs.'
49+
user_email: 'site-policy-bot@users.noreply.github.com'
50+
user_name: 'site-policy-bot'
51+
commit_msg: '${{ env.MESSAGE }}'
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Transfer REST API issue to rest-api-description
2+
3+
# **What it does**: Transfers an issue in the open source repo to the open source rest-api-description repo
4+
# **Why we have it**: Requests to change the OpenAPI schema (unless the schema is just a description update) should be made in github/rest-api-description
5+
# **Who does it impact**: Open source and docs-content maintainers
6+
7+
on:
8+
issues:
9+
types:
10+
- labeled
11+
12+
jobs:
13+
transfer-issue:
14+
name: Transfer issue
15+
runs-on: ubuntu-latest
16+
if: github.event.label.name == 'rest-schema' && github.repository == 'github/docs'
17+
steps:
18+
- name: Check if this run was triggered by a member of the docs team
19+
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
20+
id: triggered-by-member
21+
with:
22+
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
23+
result-encoding: string
24+
script: |
25+
const triggerer_login = context.payload.sender.login
26+
const teamMembers = await github.request(
27+
`/orgs/github/teams/docs/members?per_page=100`
28+
)
29+
const logins = teamMembers.data.map(member => member.login)
30+
if (logins.includes(triggerer_login)) {
31+
console.log(`This workflow was triggered by ${triggerer_login} (on the docs team).`)
32+
return 'true'
33+
}
34+
console.log(`This workflow was triggered by ${triggerer_login} (not on the docs team), so no action will be taken.`)
35+
return 'false'
36+
37+
- name: Exit if not triggered by a docs team member
38+
if: steps.triggered-by-member.outputs.result == 'false'
39+
run: |
40+
echo Aborting. This workflow must be triggered by a member of the docs team.
41+
exit 1
42+
43+
- name: Comment on the old issue
44+
run: gh issue comment $OLD_ISSUE --body "Thank you for opening this issue! Changes to the REST API schema can be requested in [github/rest-api-description](https://github.com/github/rest-api-description). I will transfer your issue over to that open source repo."
45+
env:
46+
GITHUB_TOKEN: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
47+
OLD_ISSUE: ${{ github.event.issue.html_url }}
48+
49+
- name: Transfer the issue to the rest-api-description repo
50+
run: |
51+
new_issue_url="$(gh issue transfer $OLD_ISSUE github/rest-api-description)"
52+
echo 'NEW_ISSUE='$new_issue_url >> $GITHUB_ENV
53+
env:
54+
GITHUB_TOKEN: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
55+
OLD_ISSUE: ${{ github.event.issue.html_url }}

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
7.12 KB
47.6 KB
143 KB

0 commit comments

Comments
 (0)