Skip to content

Commit 7965272

Browse files
authored
Merge branch 'main' into patch-3
2 parents 167d51b + e418b95 commit 7965272

File tree

81 files changed

+18888
-2152
lines changed

Some content is hidden

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

81 files changed

+18888
-2152
lines changed

.github/ISSUE_TEMPLATE/production-config-change.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/confirm-internal-staff-work-in-docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- id: membership_check
2323
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
24+
env:
25+
TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }}
2426
with:
2527
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
2628
script: |
@@ -59,7 +61,7 @@ jobs:
5961
// Create an issue in our private repo
6062
await github.issues.create({
6163
owner: 'github',
62-
repo: 'docs-internal',
64+
repo: process.env.TEAM_CONTENT_REPO,
6365
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
6466
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!`,
6567
labels: ['OS confirmation'],
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Move existing issues to correct docs repo
2+
3+
# **What it does**: Move all existing issues to the correct repo
4+
# **Why we have it**: We don't want engineering or content issues in the docs-internal repo
5+
# **Who does it impact**: GitHub staff.
6+
7+
on:
8+
workflow_dispatch:
9+
10+
jobs:
11+
transfer_issues:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- id: move_to_correct_repo
15+
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
16+
env:
17+
TEAM_ENGINEERING_REPO: ${{ secrets.TEAM_ENGINEERING_REPO }}
18+
TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }}
19+
with:
20+
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
21+
script: |
22+
const owner = 'github'
23+
const originalRepo = 'docs-internal'
24+
let correctRepo = process.env.TEAM_ENGINEERING_REPO
25+
26+
const correctRepoObject = await github.repos.get({
27+
owner: owner,
28+
repo: correctRepo
29+
})
30+
31+
const allIssues = await github.paginate(github.issues.listForRepo, {
32+
owner: owner,
33+
repo: originalRepo,
34+
per_page: 100,
35+
labels: ['engineering']
36+
})
37+
38+
for (const issue of allIssues) {
39+
// Extra redundancy with this additional check to be safe
40+
if (issue.labels.find(label => label.name === 'engineering')) {
41+
// Transfer the issue to the correct repo
42+
const issueNodeId = issue.node_id
43+
const correctRepositoryNodeId = correctRepoObject.data.node_id
44+
console.log(`Issue GraphQL Node ID: ${issueNodeId}`)
45+
console.log(`Repository GraphQL Node ID: ${correctRepositoryNodeId}`)
46+
47+
const mutation = `mutation ($id: ID!, $repositoryId: ID!) {
48+
transferIssue(input: {
49+
issueId: $id,
50+
repositoryId: $repositoryId
51+
}) {
52+
issue {
53+
url,
54+
number
55+
}
56+
}
57+
}`
58+
59+
const variables = {
60+
id: issueNodeId,
61+
repositoryId: correctRepositoryNodeId
62+
}
63+
64+
const graph = await github.graphql(mutation, variables)
65+
console.log('GraphQL mutation result:\n' + JSON.stringify(graph))
66+
67+
// Add the same labels to the new issue
68+
const newIssueNumber = graph.transferIssue.issue.number
69+
await github.issues.addLabels({
70+
owner: owner,
71+
repo: correctRepo,
72+
issue_number: newIssueNumber,
73+
labels: issue.labels.map(label => label.name),
74+
})
75+
}
76+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Move new issues to correct docs repo
2+
3+
# **What it does**: If anyone creates an issue in the docs-internal repo for the engineering team or the content team, move that issue and notify the author
4+
# **Why we have it**: We don't want engineering or content issues in the docs-internal repo
5+
# **Who does it impact**: GitHub staff.
6+
7+
on:
8+
issues:
9+
types:
10+
- opened
11+
- transferred
12+
- reopened
13+
14+
jobs:
15+
transfer_issue:
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
if: github.repository == 'github/docs-internal'
19+
steps:
20+
- id: move_to_correct_repo
21+
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
22+
env:
23+
TEAM_ENGINEERING_REPO: ${{ secrets.TEAM_ENGINEERING_REPO }}
24+
TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }}
25+
with:
26+
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
27+
script: |
28+
const issueNo = context.issue.number
29+
const owner = 'github'
30+
const originalRepo = 'docs-internal'
31+
32+
// See if the engineering label is present.
33+
const engineeringLabel = context.payload.issue.labels.find(label => label.name === 'engineering')
34+
35+
// Transfer engineering issues to the engineering repo and everything else to the Docs Content repo
36+
let correctRepo = process.env.TEAM_CONTENT_REPO
37+
if (engineeringLabel) {
38+
correctRepo = process.env.TEAM_ENGINEERING_REPO
39+
}
40+
41+
const correctRepoObject = await github.repos.get({
42+
owner: owner,
43+
repo: correctRepo
44+
})
45+
46+
// Post a comment in the docs-internal issue
47+
await github.issues.createComment({
48+
owner: owner,
49+
repo: originalRepo,
50+
issue_number: issueNo,
51+
body: `👋 Moving forward, we're asking that folks create all new Docs issues in the [${process.env.TEAM_ENGINEERING_REPO}](${process.env.TEAM_ENGINEERING_REPO}) repo and all new content issues in [${process.env.TEAM_CONTENT_REPO}](${process.env.TEAM_CONTENT_REPO}). We transferred it for you!`
52+
})
53+
54+
// Transfer the issue to the correct repo
55+
const issueNodeId = context.payload.issue.node_id
56+
const correctRepositoryNodeId = correctRepoObject.data.node_id
57+
console.log(`Issue GraphQL Node ID: ${issueNodeId}`)
58+
console.log(`Repository GraphQL Node ID: ${correctRepositoryNodeId}`)
59+
60+
const mutation = `mutation ($id: ID!, $repositoryId: ID!) {
61+
transferIssue(input: {
62+
issueId: $id,
63+
repositoryId: $repositoryId
64+
}) {
65+
issue {
66+
url,
67+
number
68+
}
69+
}
70+
}`
71+
72+
const variables = {
73+
id: issueNodeId,
74+
repositoryId: correctRepositoryNodeId
75+
}
76+
77+
const graph = await github.graphql(mutation, variables)
78+
console.log('GraphQL mutation result:\n' + JSON.stringify(graph))
79+
80+
// Add the same labels to the new issue
81+
const newIssueNumber = graph.transferIssue.issue.number
82+
await github.issues.addLabels({
83+
owner: owner,
84+
repo: correctRepo,
85+
issue_number: newIssueNumber,
86+
labels: context.payload.issue.labels.map(label => label.name),
87+
})

.github/workflows/send-issues-to-how-how-we-work-boards.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/send-prs-to-how-how-we-work-boards.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/update-status-labels-on-tracking-issues.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.
12.5 KB
Loading
16.2 KB
Loading
12 KB
Loading

0 commit comments

Comments
 (0)