Skip to content

Commit f2a109f

Browse files
authored
Merge branch 'main' into update-gcm-info
2 parents 1311b8e + 7e1dbae commit f2a109f

676 files changed

Lines changed: 26091 additions & 28903 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/actions-scripts/create-enterprise-issue.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ async function run() {
8686
'utf8'
8787
)
8888
const issueLabels =
89-
milestone === 'release' ? ['enterprise release'] : ['enterprise deprecation', 'priority-4', 'batch', 'time sensitive']
89+
milestone === 'release'
90+
? ['enterprise release']
91+
: ['enterprise deprecation', 'priority-4', 'batch', 'time sensitive']
9092
const issueTitle = `[${nextMilestoneDate}] Enterprise Server ${versionNumber} ${milestone} (technical steps)`
9193

9294
const issueBody = `GHES ${versionNumber} ${milestone} occurs on ${nextMilestoneDate}.

.github/actions-scripts/enable-automerge.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import { getOctokit } from '@actions/github'
2-
const token = process.env.GITHUB_TOKEN
3-
const prNumber = process.env.AUTOMERGE_PR_NUMBER
4-
const [org, repo] = process.env.GITHUB_REPOSITORY.split('/')
5-
const github = getOctokit(token)
62

73
main()
84
async function main() {
5+
const [org, repo] = process.env.GITHUB_REPOSITORY.split('/')
6+
if (!org || !repo) {
7+
throw new Error('GITHUB_REPOSITORY environment variable not set')
8+
}
9+
const prNumber = process.env.AUTOMERGE_PR_NUMBER
10+
if (!prNumber) {
11+
throw new Error(`AUTOMERGE_PR_NUMBER environment variable not set`)
12+
}
13+
const token = process.env.GITHUB_TOKEN
14+
if (!token) {
15+
throw new Error(`GITHUB_TOKEN environment variable not set`)
16+
}
17+
const github = getOctokit(token)
918
const pull = await github.rest.pulls.get({
1019
owner: org,
1120
repo: repo,

.github/actions-scripts/update-merge-queue-branch.js

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ const github = getOctokit(token)
2020
main()
2121

2222
async function main() {
23+
const [org, repo] = process.env.GITHUB_REPOSITORY.split('/')
24+
if (!org || !repo) {
25+
throw new Error('GITHUB_REPOSITORY environment variable not set')
26+
}
2327
// Get a list of open PRs and order them from oldest to newest
24-
const query = `query ($first: Int, $after: String, $firstLabels: Int) {
25-
organization(login: "github") {
26-
repository(name: "docs-internal") {
28+
const query = `query ($first: Int, $after: String, $firstLabels: Int, $repo: String!, $org: String!) {
29+
organization(login: $org) {
30+
repository(name: $repo) {
2731
pullRequests(first: $first, after: $after, states: OPEN, orderBy: {field: UPDATED_AT, direction: ASC}) {
2832
edges{
2933
node {
@@ -55,6 +59,8 @@ async function main() {
5559
}`
5660

5761
const queryVariables = {
62+
repo,
63+
org,
5864
first: 100,
5965
after: null, // when pagination in null it will get first page
6066
firstLabels: 100,
@@ -105,20 +111,25 @@ async function main() {
105111

106112
// Get the list of prs with the skip label so they can
107113
// be put at the beginning of the list
108-
const prioritizedPrList = autoMergeEnabledPRs
109-
.filter((pr) => pr.labels.includes('skip-to-front-of-merge-queue'))
110-
.concat(autoMergeEnabledPRs.filter((pr) => !pr.labels.includes('skip-to-front-of-merge-queue')))
114+
const prioritizedPrList = autoMergeEnabledPRs.sort(
115+
(a, b) =>
116+
Number(b.labels.includes('skip-to-front-of-merge-queue')) -
117+
Number(a.labels.includes('skip-to-front-of-merge-queue'))
118+
)
111119

112-
const nextInQueue = prioritizedPrList.shift()
113-
// Update the branch for the next PR in the merge queue
114-
github.rest.pulls.updateBranch({
115-
owner: 'github',
116-
repo: 'docs-internal',
117-
pull_number: parseInt(nextInQueue.number),
118-
})
120+
if (prioritizedPrList.length) {
121+
const nextInQueue = prioritizedPrList.shift()
122+
// Update the branch for the next PR in the merge queue
123+
github.rest.pulls.updateBranch({
124+
owner: org,
125+
repo,
126+
pull_number: nextInQueue.number,
127+
})
128+
console.log(`⏱ Total PRs in the merge queue: ${prioritizedPrList.length + 1}`)
129+
console.log(`🚂 Updated branch for PR #${JSON.stringify(nextInQueue, null, 2)}`)
130+
}
119131

120-
console.log(`⏱ Total PRs in the merge queue: ${prioritizedPrList.length + 1}`)
121-
console.log(`🚂 Updated branch for PR #${JSON.stringify(nextInQueue, null, 2)}`)
122-
console.log(`🚏 Next up in the queue: `)
123-
console.log(JSON.stringify(prioritizedPrList, null, 2))
132+
prioritizedPrList.length
133+
? console.log(`🚏 Next up in the queue: \n ${JSON.stringify(prioritizedPrList, null, 2)}`)
134+
: console.log(`⚡ The merge queue is empty`)
124135
}

.github/workflows/autoupdate-branch.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ jobs:
3030
name: autoupdate
3131
runs-on: ubuntu-latest
3232
steps:
33+
- name: Check out repo content
34+
uses: actions/checkout@1e204e9a9253d643386038d443f96446fa156a97
35+
36+
- name: Setup Node
37+
uses: actions/setup-node@270253e841af726300e85d718a5f606959b2903c
38+
with:
39+
node-version: 16.13.x
40+
cache: npm
41+
42+
- name: Install dependencies
43+
run: npm ci
44+
3345
- name: Update next PR in queue
3446
env:
3547
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}

.github/workflows/create-translation-batch-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
- name: Check parsing
129129
run: |
130130
node script/i18n/lint-translation-files.js --check parsing
131-
git add . && git commit -m "Run script/i18n/lint-translation-files.js --check parsin" || echo "Nothing to commit"
131+
git add . && git commit -m "Run script/i18n/lint-translation-files.js --check parsing" || echo "Nothing to commit"
132132
133133
# step 8b in docs-engineering/crowdin.md
134134
- name: Check rendering

.github/workflows/repo-sync.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ jobs:
128128
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!"
129129
pr_label: automated-reposync-pr
130130
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
131+
# This will exit 0 if there's no difference between `repo-sync`
132+
# and `main`. And if so, no PR will be created.
133+
pr_allow_empty: false
131134

132135
- name: Find pull request
133136
uses: juliangruber/find-pull-request-action@db875662766249c049b2dcd85293892d61cb0b51

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ on:
1919
jobs:
2020
sync:
2121
name: Get the latest docs
22-
if: >-
23-
github.event.pull_request.merged == true &&
24-
github.repository == 'github/docs-internal'
22+
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.repository == 'github/docs-internal')
2523
runs-on: ubuntu-latest
2624
permissions:
2725
contents: write
@@ -49,6 +47,7 @@ jobs:
4947
git checkout -b automated-sync-$GITHUB_RUN_ID
5048
git add .
5149
PR_TITLE=${{ github.event.pull_request.title }}
50+
echo PR_TITLE: $PR_TITLE
5251
[[ ! -z $PR_TITLE ]] && DESCRIPTION="${PR_TITLE}" || DESCRIPTION="Update manually triggered by workflow"
5352
echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_ENV
5453
git commit -m "$(echo $DESCRIPTION)"

.github/workflows/staging-build-pr.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Dump full context for debugging
37-
env:
38-
GITHUB_CONTEXT: ${{ toJSON(github) }}
39-
run: echo "$GITHUB_CONTEXT"
37+
run: |
38+
cat << EOF
39+
${{ toJSON(github) }}
40+
EOF
4041
4142
build-pr:
4243
if: ${{ github.repository == 'github/docs-internal' || github.repository == 'github/docs' }}

.github/workflows/transfer-to-localization-repo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
OLD_ISSUE: ${{ github.event.issue.html_url }}
6161

6262
- name: Comment on the old issue
63-
run: gh issue comment $OLD_ISSUE --body "Thank you for opening this issue! Updates to translated content must be made internally. I have copied your issue to an internal issue, so I will close this issue."
63+
run: gh issue comment $OLD_ISSUE --body "Thanks for opening this issue! Unfortunately, we are not able to accept issues for translated content. Our translation process involves an integration with an external service at crowdin.com, where all translation activity happens. We hope to eventually open up the translation process to the open-source community, but we're not there yet.See https://github.com/github/docs/blob/main/contributing/types-of-contributions.md#earth_asia-translations for more information."
6464
env:
6565
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
6666
OLD_ISSUE: ${{ github.event.issue.html_url }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ That's how you can easily become a member of the GitHub Documentation community.
3333
## READMEs
3434

3535
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:
36-
YOu can go through among them for specified details regarding the topics listed below.
36+
You can go through among them for specified details regarding the topics listed below.
3737

3838
- [content/README.md](content/README.md)
3939
- [content/graphql/README.md](content/graphql/README.md)

0 commit comments

Comments
 (0)