Skip to content

Commit 99edc47

Browse files
Merge branch 'main' into patch-1
2 parents 630607d + 11ae1b0 commit 99edc47

File tree

192 files changed

+2083
-2011
lines changed

Some content is hidden

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

192 files changed

+2083
-2011
lines changed

.github/actions-scripts/enterprise-server-issue-templates/release-issue.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng
6464
6565
☝️ This will run a workflow **on every push to the PR** that will sync **only** the English index for the new version. This will make the GHES content searchable on staging throughout content creation, and will ensure the search updates go live at the same time the content is published. See [`contributing/search.md`](https://github.com/github/docs-internal/blob/main/contributing/search.md) for details.
6666
- [ ] Get the megabranch green with passing tests as soon as possible. This typically involves fixing broken links and working with engineering to address other unexpected test failures.
67-
- [ ] In `github/github`, to create a new GHES release follow these steps (some of these steps may have already been done):
68-
- [ ] Copy the previous release's root document to a new root document for this release `cp app/api/description/ghes-<LATEST RELEASE NUMBER>.yaml app/api/description/ghes-<NEXT RELEASE NUMBER>.yaml`.
69-
- [ ] Update the `externalDocs.url` property in that file to use the new GHES release number.
67+
- [ ] In `github/github`, use a Codespace to create a pull request that adds a new GHES release. Follow these steps (some of these steps may have already been done):
7068
- [ ] Copy the previous release's configuration file to a new configuration file for this release `cp app/api/description/config/releases/ghes-<LATEST RELEASE NUMBER>.yaml app/api/description/config/releases/ghes-<NEXT RELEASE NUMBER>.yaml`.
71-
- [ ] Update the `variables.externalDocsUrl`, `variables.ghesVersion`, and `patch.[].value.url` in that file to use the new GHES release number.
69+
- [ ] Update all references to the old GHES release number in that file to use the new GHES release number. There are about 4 occurrences at the time of this writing: `variables.externalDocsUrl`, `variables.ghesVersion`, and two keys under `patch` for the paths `/info/x-github-release` and `/externalDocs`.
7270
- [ ] Update `published` in that file to `false`. **Note:** This is important to ensure that changes for the next version of the OpenAPI schema changes are not made public until the new version is released.
71+
- [ ] Run `./bin/openapi generate-root-files` to generate the `app/api/description/ghes-<LATEST RELEASE NUMBER>.yaml` file and merge the changes.
72+
- [ ] Create a PR with the two file changes `app/api/description/ghes-<NEW RELEASE NUMBER>.yaml` and `app/api/description/config/releases/ghes-<NEW RELEASE NUMBER>.yaml`
7373
- [ ] Create a second PR based on the PR created ☝️ that toggles `published` to `true` in the `app/api/description/config/releases/ghes-<NEXT RELEASE NUMBER>.yaml` file. When this PR merges it will publish the new release to the `github/rest-api-description` repo and will trigger a pull request in the `github/docs-internal` repo with the schemas for the next GHES release. There is a step in this list to merge that PR in the "Before shipping the release branch" section.
7474
- [ ] At least once a day until release, merge `main` into the megabranch and resolve any conflicts or failing tests.
7575

.github/actions/lib/get-env-inputs.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,22 @@ export function getEnvInputs(options) {
1616
})
1717
)
1818
}
19+
20+
/*
21+
* Given an environment variable key, return `true` or `false` if the
22+
* value is recognizable.
23+
* Turn 'true' or '1' into `true`. And '', '0', or 'false' into `false`.
24+
* All other values are invalid.
25+
* Now you can't accidentally set `export FOO=falsee` which as string `'falsee'`
26+
* could have been interpreted as a truthy value.
27+
*
28+
* @param {string} key - name of the environment variable
29+
*
30+
* @returns {boolean}
31+
*/
32+
export function boolEnvVar(key) {
33+
const value = process.env[key] || ''
34+
if (value === '' || value === 'false' || value === '0') return false
35+
if (value === 'true' || value === '1') return true
36+
throw new Error(`Invalid value for set environment variable ${key}: '${value}'`)
37+
}

.github/actions/rendered-content-link-checker.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import warmServer from '../../lib/warm-server.js'
1414
import renderContent from '../../lib/render-content/index.js'
1515
import { deprecated } from '../../lib/enterprise-server-releases.js'
1616
import excludedLinks from '../../lib/excluded-links.js'
17-
import { getEnvInputs } from './lib/get-env-inputs.js'
17+
import { getEnvInputs, boolEnvVar } from './lib/get-env-inputs.js'
1818
import { debugTimeEnd, debugTimeStart } from './lib/debug-time-taken.js'
1919
import { uploadArtifact as uploadArtifactLib } from './lib/upload-artifact.js'
2020
import github from '../../script/helpers/github.js'
@@ -51,23 +51,9 @@ const deprecatedVersionPrefixesRegex = new RegExp(
5151

5252
// When this file is invoked directly from action as opposed to being imported
5353
if (import.meta.url.endsWith(process.argv[1])) {
54-
// Validate that required action inputs are present
55-
getEnvInputs(['GITHUB_TOKEN'])
56-
5754
// Optional env vars
58-
const {
59-
ACTION_RUN_URL,
60-
CREATE_REPORT,
61-
CHECK_EXTERNAL_LINKS,
62-
LEVEL,
63-
SHOULD_COMMENT,
64-
COMMENT_LIMIT_TO_EXTERNAL_LINKS,
65-
FAIL_ON_FLAW,
66-
FILES_CHANGED,
67-
REPORT_REPOSITORY,
68-
REPORT_AUTHOR,
69-
REPORT_LABEL,
70-
} = process.env
55+
const { ACTION_RUN_URL, LEVEL, FILES_CHANGED, REPORT_REPOSITORY, REPORT_AUTHOR, REPORT_LABEL } =
56+
process.env
7157

7258
const octokit = github()
7359

@@ -89,21 +75,27 @@ if (import.meta.url.endsWith(process.argv[1])) {
8975
verbose: true,
9076
linkReports: true,
9177
checkImages: true,
92-
patient: true,
78+
patient: boolEnvVar('PATIENT'),
9379
random: false,
9480
language: 'en',
9581
actionUrl: ACTION_RUN_URL,
96-
checkExternalLinks: CHECK_EXTERNAL_LINKS === 'true',
97-
shouldComment: SHOULD_COMMENT === 'true',
98-
commentLimitToExternalLinks: COMMENT_LIMIT_TO_EXTERNAL_LINKS === 'true',
99-
failOnFlaw: FAIL_ON_FLAW === 'true',
100-
createReport: CREATE_REPORT === 'true',
82+
checkExternalLinks: boolEnvVar('CHECK_EXTERNAL_LINKS'),
83+
shouldComment: boolEnvVar('SHOULD_COMMENT'),
84+
commentLimitToExternalLinks: boolEnvVar('COMMENT_LIMIT_TO_EXTERNAL_LINKS'),
85+
failOnFlaw: boolEnvVar('FAIL_ON_FLAW'),
86+
createReport: boolEnvVar('CREATE_REPORT'),
10187
reportRepository: REPORT_REPOSITORY,
10288
reportLabel: REPORT_LABEL,
10389
reportAuthor: REPORT_AUTHOR,
10490
actionContext: getActionContext(),
10591
}
10692

93+
if (opts.shouldComment || opts.createReport) {
94+
// `GITHUB_TOKEN` is optional. If you need the token to post a comment
95+
// or open an issue report, you might get cryptic error messages from Octokit.
96+
getEnvInputs(['GITHUB_TOKEN'])
97+
}
98+
10799
main(coreLib, octokit, uploadArtifactLib, opts, {})
108100
}
109101

@@ -137,6 +129,7 @@ if (import.meta.url.endsWith(process.argv[1])) {
137129
* verbose {boolean} - Set to true for more verbose logging
138130
* random {boolean} - Randomize page order for debugging when true
139131
* patient {boolean} - Wait longer and retry more times for rate-limited external URLS
132+
* bail {boolean} - Throw an error on the first page (not permalink) that has >0 flaws
140133
*
141134
*/
142135
async function main(core, octokit, uploadArtifact, opts = {}) {
@@ -526,7 +519,7 @@ function getPages(pageList, languages, filters, files, max) {
526519
}
527520

528521
async function processPage(core, page, pageMap, redirects, opts) {
529-
const { verbose, verboseUrl } = opts
522+
const { verbose, verboseUrl, bail } = opts
530523

531524
const allFlawsEach = await Promise.all(
532525
page.permalinks.map((permalink) => {
@@ -540,6 +533,13 @@ async function processPage(core, page, pageMap, redirects, opts) {
540533
if (verbose) {
541534
printFlaws(core, allFlaws, { verboseUrl })
542535
}
536+
537+
if (bail) {
538+
if (!verbose) {
539+
console.warn('Use --verbose to see the flaws before it exits')
540+
}
541+
throw new Error(`More than one flaw in ${page.relativePath}`)
542+
}
543543
}
544544

545545
return allFlaws
@@ -828,7 +828,7 @@ async function innerFetch(core, url, config = {}) {
828828
// So there's no point in trying more attempts than 3 because it would
829829
// just timeout on the 10s. (i.e. 1000 + 2000 + 4000 + 8000 > 10,000)
830830
const retry = {
831-
limit: patient ? 5 : 2,
831+
limit: patient ? 6 : 2,
832832
}
833833
const timeout = { request: patient ? 10000 : 2000 }
834834

.github/workflows/link-check-daily.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
REPORT_REPOSITORY: github/docs-content
4646
CREATE_REPORT: true
4747
CHECK_EXTERNAL_LINKS: true
48+
PATIENT: true
4849
timeout-minutes: 30
4950
run: node .github/actions/rendered-content-link-checker.js
5051

.github/workflows/link-check-on-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ concurrency:
2626
jobs:
2727
check-links:
2828
runs-on: ${{ fromJSON('["ubuntu-latest", "ubuntu-20.04-xl"]')[github.repository == 'github/docs-internal'] }}
29-
if: (github.repository == 'github/docs-internal' || github.repository == 'github/docs') && github.repository_owner == 'github'
29+
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
@@ -72,7 +72,7 @@ jobs:
7272
LEVEL: 'critical'
7373
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
7474
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_FR }}
75-
SHOULD_COMMENT: true
75+
SHOULD_COMMENT: ${{ secrets.DOCS_BOT_FR != '' }}
7676
CHECK_EXTERNAL_LINKS: false
7777
CREATE_REPORT: false
7878
run: node .github/actions/rendered-content-link-checker.js

.github/workflows/orphaned-assets-check.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: 'Orphaned assets check'
77
on:
88
workflow_dispatch:
99
schedule:
10-
- cron: '13 10 * * *' # Once a day at 10:13 UTC
10+
- cron: '20 11 * * 1' # run every Monday at 11:20AM UTC
1111

1212
permissions:
1313
contents: read
@@ -17,13 +17,46 @@ jobs:
1717
if: ${{ github.repository == 'github/docs-internal' }}
1818
runs-on: ubuntu-latest
1919
steps:
20-
- name: Checkout
20+
- name: Checkout English repo
2121
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
2222
with:
2323
# Using a PAT is necessary so that the new commit will trigger the
2424
# CI in the PR. (Events from GITHUB_TOKEN don't trigger new workflows.)
2525
token: ${{ secrets.DOCUBOT_REPO_PAT }}
2626

27+
# TODO: Can be removed after we no longer keep translations in-repo
28+
- name: Remove existing language translations
29+
run: |
30+
rm -rf translations
31+
32+
- name: Checkout the es-es repo
33+
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
34+
with:
35+
repository: github/docs-internal.es-es
36+
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
37+
path: translations/es-ES
38+
39+
- name: Checkout the pt-br repo
40+
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
41+
with:
42+
repository: github/docs-internal.pt-br
43+
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
44+
path: translations/pt-BR
45+
46+
- name: Checkout the zh-cn repo
47+
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
48+
with:
49+
repository: github/docs-internal.zh-cn
50+
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
51+
path: translations/zh-CN
52+
53+
- name: Checkout the ja-jp repo
54+
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
55+
with:
56+
repository: github/docs-internal.ja-jp
57+
token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
58+
path: translations/ja-JP
59+
2760
- name: Setup node
2861
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048
2962
with:
@@ -43,7 +76,7 @@ jobs:
4376
./script/find-orphaned-assets.js | xargs git rm
4477
4578
# If nothing to commit, exit now. It's fine. No orphans.
46-
git status | grep 'nothing to commit' && exit 0
79+
git status -- ':!translations*' | grep 'nothing to commit' && exit 0
4780
4881
# Replicated from the translation pipeline PR-maker Action
4982
git config --global user.name "docubot"

.github/workflows/remove-unused-assets.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.
35.6 KB
Loading
42.1 KB
Loading

content/actions/guides.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ versions:
1010
ghec: '*'
1111
learningTracks:
1212
- getting_started
13-
- continuous_integration
14-
- continuous_deployment
15-
- deploy_to_the_cloud
1613
- adopting_github_actions_for_your_enterprise_ghec
1714
- adopting_github_actions_for_your_enterprise_ghes_and_ghae
1815
- hosting_your_own_runners

0 commit comments

Comments
 (0)