Skip to content

Commit adc566a

Browse files
authored
Merge branch 'main' into revert-19011-images-ab-test
2 parents f770a5b + 67a1c8e commit adc566a

40 files changed

Lines changed: 81 additions & 93 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
owner: 'github',
6262
repo: 'docs-internal',
6363
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
64-
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`
64+
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`,
65+
labels: ['OS confirmation'],
6566
});
6667
6768
core.setOutput('did_warn', 'true')

.github/workflows/ping-staging-apps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Ping staging apps
66

77
on:
88
schedule:
9-
- cron: '*/20 * * * *' # every twenty minutes
9+
- cron: '10,30,50 * * * *' # every twenty minutes
1010

1111
jobs:
1212
ping_staging_apps:

.github/workflows/repo-sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name: Repo Sync
1818
on:
1919
workflow_dispatch:
2020
schedule:
21-
- cron: '*/15 * * * *' # every 15 minutes
21+
- cron: '10,25,40,55 * * * *' # every 15 minutes
2222

2323
jobs:
2424
close-invalid-repo-sync:

content/developers/webhooks-and-events/github-event-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The event objects returned from the Events API endpoints have the same structure
4545
This example shows the format of the [WatchEvent](#watchevent) response when using the [Events API](/rest/reference/activity#events).
4646

4747
```
48-
Status: 200 OK
48+
HTTP/1.1 200 OK
4949
Link: <https://api.github.com/resource?page=2>; rel="next",
5050
<https://api.github.com/resource?page=5>; rel="last"
5151
```

content/rest/guides/getting-started-with-the-rest-api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ $ curl -i https://api.github.com/users/defunkt
6262
> Server: GitHub.com
6363
> Date: Sun, 11 Nov 2012 18:43:28 GMT
6464
> Content-Type: application/json; charset=utf-8
65-
> Status: 200 OK
6665
> ETag: "bfd85cbf23ac0b0c8a29bee02e7117c6"
6766
> X-RateLimit-Limit: 60
6867
> X-RateLimit-Remaining: 57

content/rest/overview/resources-in-the-rest-api.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ $ curl -I {% data variables.product.api_url_pre %}/users/octocat/orgs
3939
> Server: nginx
4040
> Date: Fri, 12 Oct 2012 23:33:14 GMT
4141
> Content-Type: application/json; charset=utf-8
42-
> Status: 200 OK
4342
> ETag: "a00049ba79152d03380c34652f2cb612"
4443
> X-GitHub-Media-Type: github.v3
4544
> X-RateLimit-Limit: 5000
@@ -376,7 +375,6 @@ The returned HTTP headers of any API request show your current rate limit status
376375
$ curl -I {% data variables.product.api_url_pre %}/users/octocat
377376
> HTTP/1.1 200 OK
378377
> Date: Mon, 01 Jul 2013 17:27:06 GMT
379-
> Status: 200 OK
380378
> X-RateLimit-Limit: 60
381379
> X-RateLimit-Remaining: 56
382380
> X-RateLimit-Reset: 1372700873
@@ -400,7 +398,6 @@ If you exceed the rate limit, an error response returns:
400398
```shell
401399
> HTTP/1.1 403 Forbidden
402400
> Date: Tue, 20 Aug 2013 14:50:41 GMT
403-
> Status: 403 Forbidden
404401
> X-RateLimit-Limit: 60
405402
> X-RateLimit-Remaining: 0
406403
> X-RateLimit-Reset: 1377013266
@@ -421,7 +418,6 @@ If your OAuth application needs to make unauthenticated calls with a higher rate
421418
$ curl -u my_client_id:my_client_secret {% data variables.product.api_url_pre %}/user/repos
422419
> HTTP/1.1 200 OK
423420
> Date: Mon, 01 Jul 2013 17:27:06 GMT
424-
> Status: 200 OK
425421
> X-RateLimit-Limit: 5000
426422
> X-RateLimit-Remaining: 4966
427423
> X-RateLimit-Reset: 1372700873
@@ -510,7 +506,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user
510506
> Cache-Control: private, max-age=60
511507
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
512508
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
513-
> Status: 200 OK
514509
> Vary: Accept, Authorization, Cookie
515510
> X-RateLimit-Limit: 5000
516511
> X-RateLimit-Remaining: 4996
@@ -521,7 +516,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b
521516
> Cache-Control: private, max-age=60
522517
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
523518
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
524-
> Status: 304 Not Modified
525519
> Vary: Accept, Authorization, Cookie
526520
> X-RateLimit-Limit: 5000
527521
> X-RateLimit-Remaining: 4996
@@ -531,7 +525,6 @@ $ curl -I {% data variables.product.api_url_pre %}/user -H "If-Modified-Since: T
531525
> HTTP/1.1 304 Not Modified
532526
> Cache-Control: private, max-age=60
533527
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
534-
> Status: 304 Not Modified
535528
> Vary: Accept, Authorization, Cookie
536529
> X-RateLimit-Limit: 5000
537530
> X-RateLimit-Remaining: 4996

content/rest/reference/activity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ To get a feed in Atom format, you must specify the `application/atom+xml` type i
5656
#### Response
5757

5858
```shell
59-
Status: 200 OK
59+
HTTP/1.1 200 OK
6060
```
6161

6262
```xml
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env node
2+
3+
// [start-readme]
4+
//
5+
// Run this script to fix known frontmatter errors by copying values from english file
6+
// Translatable properties are designated in the frontmatter JSON schema
7+
//
8+
// [end-readme]
9+
10+
const { execSync } = require('child_process')
11+
const fs = require('fs')
12+
const path = require('path')
13+
const readFileAsync = require('../../lib/readfile-async')
14+
const fm = require('../../lib/frontmatter')
15+
const matter = require('gray-matter')
16+
17+
const extractFrontmatter = async (path) => {
18+
const fileContents = await readFileAsync(path, 'utf8')
19+
return fm(fileContents)
20+
}
21+
22+
// Find all content files that differ from the default branch
23+
// TODO: make sure this will work in an Actions workflow
24+
const cmd = 'git -c diff.renameLimit=10000 diff --name-only origin/main'
25+
const changedFilesRelPaths = execSync(cmd)
26+
.toString()
27+
.split('\n')
28+
.filter(filename => {
29+
return filename.startsWith('translations/') &&
30+
filename.includes('/content/') &&
31+
!filename.endsWith('README.md')
32+
})
33+
34+
changedFilesRelPaths.forEach(async (relPath) => {
35+
const localisedAbsPath = path.join(__dirname, '../..', relPath)
36+
// find the corresponding english file by removing the first 2 path segments: /translations/<language code>
37+
const engAbsPath = path.join(__dirname, '../..', relPath.split(path.sep).slice(2).join(path.sep))
38+
39+
const localisedFrontmatter = await extractFrontmatter(localisedAbsPath)
40+
if (!localisedFrontmatter) return
41+
42+
// Load frontmatter from the source english file
43+
const englishFrontmatter = await extractFrontmatter(engAbsPath)
44+
45+
// Look for differences between the english and localised non-translatable properties
46+
let overWroteSomething = false
47+
for (const prop in englishFrontmatter.data) {
48+
if (!fm.schema.properties[prop].translatable && localisedFrontmatter.data[prop] !== englishFrontmatter.data[prop]) {
49+
localisedFrontmatter.data[prop] = englishFrontmatter.data[prop]
50+
overWroteSomething = true
51+
}
52+
}
53+
54+
// rewrite the localised file, if it changed
55+
if (overWroteSomething) {
56+
const toWrite = matter.stringify(localisedFrontmatter.content, localisedFrontmatter.data, { lineWidth: 10000, forceQuotes: true })
57+
fs.writeFileSync(localisedAbsPath, toWrite)
58+
}
59+
})

translations/de-DE/content/developers/webhooks-and-events/github-event-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The event objects returned from the Events API endpoints have the same structure
4545
This example shows the format of the [WatchEvent](#watchevent) response when using the [Events API](/rest/reference/activity#events).
4646

4747
```
48-
Status: 200 OK
48+
HTTP/1.1 200 OK
4949
Link: <https://api.github.com/resource?page=2>; rel="next",
5050
<https://api.github.com/resource?page=5>; rel="last"
5151
```

translations/de-DE/content/rest/guides/getting-started-with-the-rest-api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ $ curl -i https://api.github.com/users/defunkt
5757
> Server: GitHub.com
5858
> Date: Sun, 11 Nov 2012 18:43:28 GMT
5959
> Content-Type: application/json; charset=utf-8
60-
> Status: 200 OK
6160
> ETag: "bfd85cbf23ac0b0c8a29bee02e7117c6"
6261
> X-RateLimit-Limit: 60
6362
> X-RateLimit-Remaining: 57

0 commit comments

Comments
 (0)