From 6fa5bd69f0f88959afbdedc7707b9b858fda3b40 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 23 Feb 2021 20:29:57 -0500 Subject: [PATCH 01/17] add script to update internal links --- script/update-internal-links.js | 173 ++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100755 script/update-internal-links.js diff --git a/script/update-internal-links.js b/script/update-internal-links.js new file mode 100755 index 000000000000..7244514d1d96 --- /dev/null +++ b/script/update-internal-links.js @@ -0,0 +1,173 @@ +#!/usr/bin/env node + +const fs = require('fs') +const walk = require('walk-sync') +const path = require('path') +const astFromMarkdown = require('mdast-util-from-markdown') +const visit = require('unist-util-visit') +const { loadPages, loadPageMap } = require('../lib/pages') +const loadSiteData = require('../lib/site-data') +const loadRedirects = require('../lib/redirects/precompile') +const { getPathWithoutLanguage, getPathWithoutVersion } = require('../lib/path-utils') +const allVersions = Object.keys(require('../lib/all-versions')) +const frontmatter = require('../lib/read-frontmatter') +const renderContent = require('../lib/render-content') +const patterns = require('../lib/patterns') + +const walkFiles = (pathToWalk) => { + return walk(path.join(process.cwd(), pathToWalk), { includeBasePath: true, directories: false }) + .filter(file => file.endsWith('.md') && !file.endsWith('README.md')) + .filter(file => !file.includes('/early-access/')) // ignore EA for now +} + +const allFiles = walkFiles('content').concat(walkFiles('data')) + +// [start-readme] +// +// Run this script to find internal links in all content and data Markdown files, check if either the title or link +// (or both) are outdated, and automatically update them if so. +// +// Exceptions: +// * Links with fragments (e.g., [Bar](/foo#bar)) will get their root links updated if necessary, but the fragment +// and title will be unchanged (e.g., [Bar](/noo#bar)). +// * Links with hardcoded versions (e.g., [Foo](/enterprise-server/baz)) will get their root links updated if +// necessary, but the hardcoded versions will be preserved (e.g., [Foo](/enterprise-server/qux)). +// * Links with Liquid in the titles will have their root links updated if necessary, but the titles will be preserved. +// +// [end-readme] + +main() + +async function main () { + console.log('Working...') + const pageList = await loadPages() + const pageMap = await loadPageMap(pageList) + const redirects = await loadRedirects(pageList) + const site = await loadSiteData() + + const context = { + pages: pageMap, + redirects, + site: site.en.site, + currentLanguage: 'en' + } + + for (const file of allFiles) { + const { data, content } = frontmatter(fs.readFileSync(file, 'utf8')) + const ast = astFromMarkdown(content) + + let newContent = content + + // We can't do async functions within visit, so gather the nodes upfront + const nodesPerFile = [] + + visit(ast, node => { + if (node.type !== 'link') return + if (!node.url.startsWith('/')) return + if (node.url.startsWith('/assets')) return + if (node.url.startsWith('/public')) return + if (node.url.includes('/11.10.340/')) return + if (node.url.includes('/2.1/')) return + if (node.url === '/') return + + nodesPerFile.push(node) + }) + + // For every Markdown link... + for (const node of nodesPerFile) { + const oldLink = node.url + const oldTitle = node.children[0].value || node.children[0].children[0].value + const oldMarkdownLink = `[${oldTitle}](${oldLink})` + + // As a blanket rule, only update links with quotes around them. + // Update: "[Foo](/foo)" + // Do not update: [Bar](/bar) + let noQuotesAroundLink + if (!newContent.includes(`"${oldMarkdownLink}`)) { + noQuotesAroundLink = true + } + + let foundPage, fragmentMatch, versionMatch + + // Run through all supported versions... + for (const version of allVersions) { + context.currentVersion = version + // Render the link for each version using the renderContent pipeline, which incluides the rewrite-local-links plugin. + const $ = await renderContent(oldMarkdownLink, context, { cheerioObject: true }) + let linkToCheck = $('a').attr('href') + + // We need to preserve fragments and hardcoded versions if any are found. + fragmentMatch = oldLink.match(/(#.*$)/) + versionMatch = oldLink.match(/(enterprise-server[/@].*?)\//) + + // Remove the fragment for now. + linkToCheck = linkToCheck + .replace(/#.*$/, '') + .replace(patterns.trailingSlash, '$1') + + // Try to find the rendered link in the set of pages! + foundPage = findPage(linkToCheck, pageMap, redirects) + + // Once a page is found for a particular version, exit immediately; we don't need to check the other versions + // because all we care about is the page title and path. + if (foundPage) { + break + } + } + + if (!foundPage) { + console.error(`Can't find link in pageMap! ${oldLink} in ${file.replace(process.cwd(), '')}`) + process.exit(1) + } + + // If the original link includes a fragment or the original title includes Liquid, do not change; + // otherwise, use the found page title. (We don't want to update the title if a fragment is found because + // the title likely points to the fragment section header, not the page title.) + const newTitle = fragmentMatch || oldTitle.includes('{%') || noQuotesAroundLink ? oldTitle : foundPage.title + + // If the original link includes a fragment, append it to the found page path. + // Also remove the language code because Markdown links don't include language codes. + let newLink = getPathWithoutLanguage(fragmentMatch ? foundPage.path + fragmentMatch[1] : foundPage.path) + + // If the original link includes a hardcoded version, preserve it; otherwise, remove versioning + // because Markdown links don't include versioning. + newLink = versionMatch ? `/${versionMatch[1]}${getPathWithoutVersion(newLink)}` : getPathWithoutVersion(newLink) + + let newMarkdownLink = `[${newTitle}](${newLink})` + + // Handle a few misplaced quotation marks. + if (oldMarkdownLink.includes('["')) { + newMarkdownLink = `"${newMarkdownLink}` + } + + // Stream the results to console as we find them. + if (oldMarkdownLink !== newMarkdownLink) { + console.log('old link', oldMarkdownLink) + console.log('new link', newMarkdownLink) + console.log('-------') + } + + newContent = newContent.replace(oldMarkdownLink, newMarkdownLink) + } + + fs.writeFileSync(file, frontmatter.stringify(newContent, data, { lineWidth: 10000 })) + } + + console.log('Done!') +} + +function findPage (tryPath, pageMap, redirects) { + if (pageMap[tryPath]) { + return { + title: pageMap[tryPath].title, + path: tryPath + } + } + + if (pageMap[redirects[tryPath]]) { + return { + title: pageMap[redirects[tryPath]].title, + path: redirects[tryPath] + } + } +} From 2aa1347bc64fad87fb0e39165041727f328510c1 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 23 Feb 2021 20:30:09 -0500 Subject: [PATCH 02/17] add option to return cheerio object from renderContent instead of html --- lib/render-content/renderContent.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/render-content/renderContent.js b/lib/render-content/renderContent.js index c4bc7e1d418c..b6a81938768c 100644 --- a/lib/render-content/renderContent.js +++ b/lib/render-content/renderContent.js @@ -66,6 +66,10 @@ module.exports = async function renderContent ( .trim() } + if (options.cheerioObject) { + return cheerio.load(html, { xmlMode: true }) + } + if (options.encodeEntities) html = entities.encode(html) return html.trim() From a687c39e8aea66ade57c9ac0386180ae4368577f Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 23 Feb 2021 20:48:38 -0500 Subject: [PATCH 03/17] lint --- script/update-internal-links.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index 7244514d1d96..411fc6b1f45c 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -26,12 +26,12 @@ const allFiles = walkFiles('content').concat(walkFiles('data')) // // Run this script to find internal links in all content and data Markdown files, check if either the title or link // (or both) are outdated, and automatically update them if so. -// +// // Exceptions: -// * Links with fragments (e.g., [Bar](/foo#bar)) will get their root links updated if necessary, but the fragment +// * Links with fragments (e.g., [Bar](/foo#bar)) will get their root links updated if necessary, but the fragment // and title will be unchanged (e.g., [Bar](/noo#bar)). // * Links with hardcoded versions (e.g., [Foo](/enterprise-server/baz)) will get their root links updated if -// necessary, but the hardcoded versions will be preserved (e.g., [Foo](/enterprise-server/qux)). +// necessary, but the hardcoded versions will be preserved (e.g., [Foo](/enterprise-server/qux)). // * Links with Liquid in the titles will have their root links updated if necessary, but the titles will be preserved. // // [end-readme] From d747ab227df376b1626efb6d9f47bde56fe32840 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 23 Feb 2021 21:18:06 -0500 Subject: [PATCH 04/17] preserve any inline markup in link titles --- script/update-internal-links.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index 411fc6b1f45c..3fd0ad549e00 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -22,6 +22,13 @@ const walkFiles = (pathToWalk) => { const allFiles = walkFiles('content').concat(walkFiles('data')) +// The script will throw an error if it finds any markup not represented here. +// Hacky but it captures the current rare edge cases. +const linkInlineMarkup = { + 'emphasis': '*', + 'strong': '**' +} + // [start-readme] // // Run this script to find internal links in all content and data Markdown files, check if either the title or link @@ -76,10 +83,22 @@ async function main () { // For every Markdown link... for (const node of nodesPerFile) { const oldLink = node.url + + // Find and preserve any inline markup in link titles, like [*Foo*](/foo) + let inlineMarkup = '' + if (node.children[0].children) { + inlineMarkup = linkInlineMarkup[node.children[0].type] + + if (!inlineMarkup) { + console.error(`Cannot find an inline markup entry for ${node.children[0].type}!`) + process.exit(1) + } + } + const oldTitle = node.children[0].value || node.children[0].children[0].value - const oldMarkdownLink = `[${oldTitle}](${oldLink})` + const oldMarkdownLink = `[${inlineMarkup}${oldTitle}${inlineMarkup}](${oldLink})` - // As a blanket rule, only update links with quotes around them. + // As a blanket rule, only update titles in links that have quotes around them. // Update: "[Foo](/foo)" // Do not update: [Bar](/bar) let noQuotesAroundLink @@ -133,7 +152,7 @@ async function main () { // because Markdown links don't include versioning. newLink = versionMatch ? `/${versionMatch[1]}${getPathWithoutVersion(newLink)}` : getPathWithoutVersion(newLink) - let newMarkdownLink = `[${newTitle}](${newLink})` + let newMarkdownLink = `[${inlineMarkup}${newTitle}${inlineMarkup}](${newLink})` // Handle a few misplaced quotation marks. if (oldMarkdownLink.includes('["')) { From 50bbee779346be8e040f3f91359827f488a675a4 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 23 Feb 2021 21:27:16 -0500 Subject: [PATCH 05/17] lint --- script/update-internal-links.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index 3fd0ad549e00..a2eb9ea92811 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -25,8 +25,8 @@ const allFiles = walkFiles('content').concat(walkFiles('data')) // The script will throw an error if it finds any markup not represented here. // Hacky but it captures the current rare edge cases. const linkInlineMarkup = { - 'emphasis': '*', - 'strong': '**' + emphasis: '*', + strong: '**' } // [start-readme] From 7fb5ab6da5ec6948a8e65f7f9e943c29f4a88812 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Wed, 24 Feb 2021 15:33:23 -0500 Subject: [PATCH 06/17] Update script/update-internal-links.js Co-authored-by: Kevin Heis --- script/update-internal-links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index a2eb9ea92811..c5c835d0a7f6 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -111,7 +111,7 @@ async function main () { // Run through all supported versions... for (const version of allVersions) { context.currentVersion = version - // Render the link for each version using the renderContent pipeline, which incluides the rewrite-local-links plugin. + // Render the link for each version using the renderContent pipeline, which includes the rewrite-local-links plugin. const $ = await renderContent(oldMarkdownLink, context, { cheerioObject: true }) let linkToCheck = $('a').attr('href') From 030eb97366785b7e6bbe4978582414759595595d Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Wed, 24 Feb 2021 16:12:58 -0500 Subject: [PATCH 07/17] simplify boolean var --- script/update-internal-links.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index a2eb9ea92811..4dff0c756965 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -101,10 +101,7 @@ async function main () { // As a blanket rule, only update titles in links that have quotes around them. // Update: "[Foo](/foo)" // Do not update: [Bar](/bar) - let noQuotesAroundLink - if (!newContent.includes(`"${oldMarkdownLink}`)) { - noQuotesAroundLink = true - } + const hasQuotesAroundLink = newContent.includes(`"${oldMarkdownLink}`) let foundPage, fragmentMatch, versionMatch @@ -142,7 +139,7 @@ async function main () { // If the original link includes a fragment or the original title includes Liquid, do not change; // otherwise, use the found page title. (We don't want to update the title if a fragment is found because // the title likely points to the fragment section header, not the page title.) - const newTitle = fragmentMatch || oldTitle.includes('{%') || noQuotesAroundLink ? oldTitle : foundPage.title + const newTitle = fragmentMatch || oldTitle.includes('{%') || !hasQuotesAroundLink ? oldTitle : foundPage.title // If the original link includes a fragment, append it to the found page path. // Also remove the language code because Markdown links don't include language codes. From 4e75f0392e7ae607165dd6a8ada5107ffe327cee Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 2 Mar 2021 10:40:31 -0500 Subject: [PATCH 08/17] handle currentVersion with spaces around it that prevent the AST parser from recognizing it as a link --- script/update-internal-links.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index 9cc660d0efb3..ffeeda074cd6 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -29,6 +29,9 @@ const linkInlineMarkup = { strong: '**' } +const currentVersionWithSpacesRegex = /\/enterprise\/{{ currentVersion }}/g +const currentVersionWithoutSpaces = '/enterprise/{{currentVersion}}' + // [start-readme] // // Run this script to find internal links in all content and data Markdown files, check if either the title or link @@ -61,10 +64,14 @@ async function main () { for (const file of allFiles) { const { data, content } = frontmatter(fs.readFileSync(file, 'utf8')) - const ast = astFromMarkdown(content) - let newContent = content + // Do a blanket find-replace for /enterprise/{{ currentVersion }}/ to /enterprise/{{currentVersion}}/ + // so that the AST parser recognizes the link as a link node. The spaces prevent it from doing so. + newContent = newContent.replace(currentVersionWithSpacesRegex, currentVersionWithoutSpaces) + + const ast = astFromMarkdown(newContent) + // We can't do async functions within visit, so gather the nodes upfront const nodesPerFile = [] @@ -98,8 +105,9 @@ async function main () { const oldTitle = node.children[0].value || node.children[0].children[0].value const oldMarkdownLink = `[${inlineMarkup}${oldTitle}${inlineMarkup}](${oldLink})` - // As a blanket rule, only update titles in links that have quotes around them. - // Update: "[Foo](/foo)" + // As a blanket rule, only update titles in links that begin with quotes. (Many links + // have punctuation before the closing quotes, so we'll only check for opening quotes.) + // Update: "[Foo](/foo) // Do not update: [Bar](/bar) const hasQuotesAroundLink = newContent.includes(`"${oldMarkdownLink}`) @@ -136,7 +144,7 @@ async function main () { process.exit(1) } - // If the original link includes a fragment or the original title includes Liquid, do not change; + // If the original link includes a fragment OR the original title includes Liquid, do not change; // otherwise, use the found page title. (We don't want to update the title if a fragment is found because // the title likely points to the fragment section header, not the page title.) const newTitle = fragmentMatch || oldTitle.includes('{%') || !hasQuotesAroundLink ? oldTitle : foundPage.title From fc18a1b6ea925821989ccf88748c72c91a19e379 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 2 Mar 2021 15:11:31 -0500 Subject: [PATCH 09/17] fix the regex --- script/update-internal-links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index ffeeda074cd6..11891b914d8e 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -122,7 +122,7 @@ async function main () { // We need to preserve fragments and hardcoded versions if any are found. fragmentMatch = oldLink.match(/(#.*$)/) - versionMatch = oldLink.match(/(enterprise-server[/@].*?)\//) + versionMatch = oldLink.match(/(enterprise-server(?:@.[^\/]*?)?)\//) // Remove the fragment for now. linkToCheck = linkToCheck From 86b39f888bb5ce81c4f99e0290e481365dbccac8 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 2 Mar 2021 15:25:16 -0500 Subject: [PATCH 10/17] script should not walk translations content dirs --- script/update-internal-links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index 11891b914d8e..81b1a3212e2f 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -15,7 +15,7 @@ const renderContent = require('../lib/render-content') const patterns = require('../lib/patterns') const walkFiles = (pathToWalk) => { - return walk(path.join(process.cwd(), pathToWalk), { includeBasePath: true, directories: false }) + return walk(path.posix.join(__dirname, '..', pathToWalk), { includeBasePath: true, directories: false }) .filter(file => file.endsWith('.md') && !file.endsWith('README.md')) .filter(file => !file.includes('/early-access/')) // ignore EA for now } From 67c90c636e320a182d1e410fc8515235a58fa26f Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Tue, 2 Mar 2021 15:42:37 -0500 Subject: [PATCH 11/17] lint --- script/update-internal-links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/update-internal-links.js b/script/update-internal-links.js index 81b1a3212e2f..2089937becf1 100755 --- a/script/update-internal-links.js +++ b/script/update-internal-links.js @@ -122,7 +122,7 @@ async function main () { // We need to preserve fragments and hardcoded versions if any are found. fragmentMatch = oldLink.match(/(#.*$)/) - versionMatch = oldLink.match(/(enterprise-server(?:@.[^\/]*?)?)\//) + versionMatch = oldLink.match(/(enterprise-server(?:@.[^/]*?)?)\//) // Remove the fragment for now. linkToCheck = linkToCheck From 391190929b74644198c5cd7ede9ca518ac863230 Mon Sep 17 00:00:00 2001 From: mchammer01 <42146119+mchammer01@users.noreply.github.com> Date: Wed, 3 Mar 2021 14:31:09 +0000 Subject: [PATCH 12/17] fixed broken links and images --- ...p-down.png => click-branch-in-drop-down-mac.png} | Bin .../about-searching-on-github.md | 2 +- data/reusables/user-settings/oauth_apps.md | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename assets/images/help/desktop/{click-branch-in-drop-down.png => click-branch-in-drop-down-mac.png} (100%) diff --git a/assets/images/help/desktop/click-branch-in-drop-down.png b/assets/images/help/desktop/click-branch-in-drop-down-mac.png similarity index 100% rename from assets/images/help/desktop/click-branch-in-drop-down.png rename to assets/images/help/desktop/click-branch-in-drop-down-mac.png diff --git a/content/github/searching-for-information-on-github/about-searching-on-github.md b/content/github/searching-for-information-on-github/about-searching-on-github.md index bcbeedfddc20..39c71d8a5b90 100644 --- a/content/github/searching-for-information-on-github/about-searching-on-github.md +++ b/content/github/searching-for-information-on-github/about-searching-on-github.md @@ -45,7 +45,7 @@ You can search for the following information across all repositories you can acc - [Discussions](/github/searching-for-information-on-github/searching-discussions){% endif %} - [Code](/articles/searching-code) - [Commits](/articles/searching-commits) -- [Users](/articles/searching-users){% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@latest" or currentVersion ver_gt "enterprise-server@2.1" %} +- [Users](/articles/searching-users){% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@latest" or currentVersion ver_gt "enterprise-server@2.21" %} - [Packages](/github/searching-for-information-on-github/searching-for-packages){% endif %} - [Wikis](/articles/searching-wikis) diff --git a/data/reusables/user-settings/oauth_apps.md b/data/reusables/user-settings/oauth_apps.md index 04f120ca6611..dca540647ba8 100644 --- a/data/reusables/user-settings/oauth_apps.md +++ b/data/reusables/user-settings/oauth_apps.md @@ -1,2 +1,2 @@ 1. In the left sidebar, click **OAuth Apps**. -![OAuth Apps section](/assets/images/settings/developer-settings-oauth-apps.png) +![OAuth Apps section](/assets/images/help/settings/developer-settings-oauth-apps.png) From e3ef829b89b213df3ba276e3f0b420535eeb51b7 Mon Sep 17 00:00:00 2001 From: mchammer01 <42146119+mchammer01@users.noreply.github.com> Date: Wed, 3 Mar 2021 14:52:13 +0000 Subject: [PATCH 13/17] fix versioning --- .../permission-levels-for-a-user-account-repository.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md b/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md index 643cde65ad66..9c5a0d2a5e41 100644 --- a/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md +++ b/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md @@ -36,7 +36,7 @@ The repository owner has full control of the repository. In addition to the acti | Manage the repository's topics | "[Classifying your repository with topics](/github/administering-a-repository/classifying-your-repository-with-topics)" |{% if currentVersion == "free-pro-team@latest" %} | Manage security and analysis settings for the repository | "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %} | Enable the dependency graph for a private repository | "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)" |{% endif %} -{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}| Delete and restore packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% elsif currentVersion ver_lt "enterprise-server@3.1" or currentVersion == "github-ae@latest" %}| Delete packages | "[Deleting packages](/packages/learn-github-packages/deleting-a-package)" |{% endif %} +{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}| Delete and restore packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% elsif currentVersion == "enterprise-server@2.22" or currentVersion == "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}| Delete packages | "[Deleting packages](/packages/learn-github-packages/deleting-a-package)" |{% endif %} | Customize the repository's social media preview | "[Customizing your repository's social media preview](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" | | Create a template from the repository | "[Creating a template repository](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %} | Receive {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}{% data variables.product.prodname_dependabot_alerts %}{% else %}security alerts{% endif %} for vulnerable dependencies | "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %} From 012c39bc591f4bc513cfbfb9552064ed9d0bbf7d Mon Sep 17 00:00:00 2001 From: mchammer01 <42146119+mchammer01@users.noreply.github.com> Date: Thu, 4 Mar 2021 12:07:34 +0000 Subject: [PATCH 14/17] fix table formatting issue --- .../permission-levels-for-a-user-account-repository.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md b/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md index 9c5a0d2a5e41..11c66a83ac80 100644 --- a/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md +++ b/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md @@ -35,8 +35,7 @@ The repository owner has full control of the repository. In addition to the acti | Delete the repository | "[Deleting a repository](/github/administering-a-repository/deleting-a-repository)" | | Manage the repository's topics | "[Classifying your repository with topics](/github/administering-a-repository/classifying-your-repository-with-topics)" |{% if currentVersion == "free-pro-team@latest" %} | Manage security and analysis settings for the repository | "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %} -| Enable the dependency graph for a private repository | "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)" |{% endif %} -{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}| Delete and restore packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% elsif currentVersion == "enterprise-server@2.22" or currentVersion == "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}| Delete packages | "[Deleting packages](/packages/learn-github-packages/deleting-a-package)" |{% endif %} +| Enable the dependency graph for a private repository | "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}| Delete and restore packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% endif %}{% if currentVersion == "enterprise-server@2.22" or currentVersion == "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}| Delete packages | "[Deleting packages](/packages/learn-github-packages/deleting-a-package)" |{% endif %} | Customize the repository's social media preview | "[Customizing your repository's social media preview](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" | | Create a template from the repository | "[Creating a template repository](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %} | Receive {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}{% data variables.product.prodname_dependabot_alerts %}{% else %}security alerts{% endif %} for vulnerable dependencies | "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %} From 2e4a684a37b2dba5276090083318503b6e498a4b Mon Sep 17 00:00:00 2001 From: mc <42146119+mchammer01@users.noreply.github.com> Date: Thu, 4 Mar 2021 13:54:07 +0000 Subject: [PATCH 15/17] Update content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> --- .../permission-levels-for-a-user-account-repository.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md b/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md index 11c66a83ac80..94aee824d875 100644 --- a/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md +++ b/content/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository.md @@ -35,7 +35,9 @@ The repository owner has full control of the repository. In addition to the acti | Delete the repository | "[Deleting a repository](/github/administering-a-repository/deleting-a-repository)" | | Manage the repository's topics | "[Classifying your repository with topics](/github/administering-a-repository/classifying-your-repository-with-topics)" |{% if currentVersion == "free-pro-team@latest" %} | Manage security and analysis settings for the repository | "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %} -| Enable the dependency graph for a private repository | "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}| Delete and restore packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% endif %}{% if currentVersion == "enterprise-server@2.22" or currentVersion == "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}| Delete packages | "[Deleting packages](/packages/learn-github-packages/deleting-a-package)" |{% endif %} +| Enable the dependency graph for a private repository | "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository#enabling-and-disabling-the-dependency-graph-for-a-private-repository)" |{% endif %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %} +| Delete and restore packages | "[Deleting and restoring a package](/packages/learn-github-packages/deleting-and-restoring-a-package)" |{% endif %}{% if currentVersion == "enterprise-server@2.22" or currentVersion == "enterprise-server@3.0" or currentVersion == "github-ae@latest" %} +| Delete packages | "[Deleting packages](/packages/learn-github-packages/deleting-a-package)" |{% endif %} | Customize the repository's social media preview | "[Customizing your repository's social media preview](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" | | Create a template from the repository | "[Creating a template repository](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %} | Receive {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}{% data variables.product.prodname_dependabot_alerts %}{% else %}security alerts{% endif %} for vulnerable dependencies | "[About alerts for vulnerable dependencies](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies)" |{% endif %}{% if currentVersion == "free-pro-team@latest" %} From c01b7fa33f1d9428d8a18a74b36d377e92e2bdd5 Mon Sep 17 00:00:00 2001 From: Chiedo John <2156688+chiedo@users.noreply.github.com> Date: Thu, 4 Mar 2021 10:56:58 -0500 Subject: [PATCH 16/17] Remove Browser Tests until it works again (#18088) * Remove Browser Test until it works again * Readd workflow and just disable the common triggers Co-authored-by: chiedo Co-authored-by: James M. Greene --- .github/workflows/browser-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/browser-test.yml b/.github/workflows/browser-test.yml index e9d51dbee3bf..a27ff0faf94a 100644 --- a/.github/workflows/browser-test.yml +++ b/.github/workflows/browser-test.yml @@ -2,10 +2,10 @@ name: Browser Tests on: workflow_dispatch: - push: - branches: - - main - pull_request: + # push: + # branches: + # - main + # pull_request: jobs: see_if_should_skip: From 05c3952ebe678b2d389780a837360ae3b1a0f66e Mon Sep 17 00:00:00 2001 From: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com> Date: Thu, 4 Mar 2021 13:15:32 -0500 Subject: [PATCH 17/17] Update OpenAPI Descriptions --- lib/rest/static/dereferenced/api.github.com.deref.json | 3 ++- lib/rest/static/dereferenced/ghes-2.18.deref.json | 3 ++- lib/rest/static/dereferenced/ghes-2.19.deref.json | 3 ++- lib/rest/static/dereferenced/ghes-2.20.deref.json | 3 ++- lib/rest/static/dereferenced/ghes-2.21.deref.json | 3 ++- lib/rest/static/dereferenced/ghes-2.22.deref.json | 3 ++- lib/rest/static/dereferenced/ghes-3.0.deref.json | 3 ++- lib/rest/static/dereferenced/github.ae.deref.json | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/rest/static/dereferenced/api.github.com.deref.json b/lib/rest/static/dereferenced/api.github.com.deref.json index 26dad9edd4d2..00c3684a744c 100644 --- a/lib/rest/static/dereferenced/api.github.com.deref.json +++ b/lib/rest/static/dereferenced/api.github.com.deref.json @@ -139709,7 +139709,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -139719,6 +139719,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true diff --git a/lib/rest/static/dereferenced/ghes-2.18.deref.json b/lib/rest/static/dereferenced/ghes-2.18.deref.json index 98d31cf02680..60f8c07e656b 100644 --- a/lib/rest/static/dereferenced/ghes-2.18.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.18.deref.json @@ -79203,7 +79203,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -79213,6 +79213,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true diff --git a/lib/rest/static/dereferenced/ghes-2.19.deref.json b/lib/rest/static/dereferenced/ghes-2.19.deref.json index c52215602e03..964a87c651dc 100644 --- a/lib/rest/static/dereferenced/ghes-2.19.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.19.deref.json @@ -82135,7 +82135,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -82145,6 +82145,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true diff --git a/lib/rest/static/dereferenced/ghes-2.20.deref.json b/lib/rest/static/dereferenced/ghes-2.20.deref.json index 89f1d6cecace..57b02273835e 100644 --- a/lib/rest/static/dereferenced/ghes-2.20.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.20.deref.json @@ -84244,7 +84244,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -84254,6 +84254,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true diff --git a/lib/rest/static/dereferenced/ghes-2.21.deref.json b/lib/rest/static/dereferenced/ghes-2.21.deref.json index a67d1a6ad7bb..4cb1030e7668 100644 --- a/lib/rest/static/dereferenced/ghes-2.21.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.21.deref.json @@ -95077,7 +95077,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -95087,6 +95087,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true diff --git a/lib/rest/static/dereferenced/ghes-2.22.deref.json b/lib/rest/static/dereferenced/ghes-2.22.deref.json index cba6256f39f8..eb9f47ad3d9b 100644 --- a/lib/rest/static/dereferenced/ghes-2.22.deref.json +++ b/lib/rest/static/dereferenced/ghes-2.22.deref.json @@ -121969,7 +121969,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -121979,6 +121979,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true diff --git a/lib/rest/static/dereferenced/ghes-3.0.deref.json b/lib/rest/static/dereferenced/ghes-3.0.deref.json index 43df848cff77..d8b0b9a31132 100644 --- a/lib/rest/static/dereferenced/ghes-3.0.deref.json +++ b/lib/rest/static/dereferenced/ghes-3.0.deref.json @@ -127095,7 +127095,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -127105,6 +127105,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true diff --git a/lib/rest/static/dereferenced/github.ae.deref.json b/lib/rest/static/dereferenced/github.ae.deref.json index dadb4965e616..f444de041c07 100644 --- a/lib/rest/static/dereferenced/github.ae.deref.json +++ b/lib/rest/static/dereferenced/github.ae.deref.json @@ -109550,7 +109550,7 @@ "name", "head_sha" ], - "anyOf": [ + "oneOf": [ { "properties": { "status": { @@ -109560,6 +109560,7 @@ } }, "required": [ + "status", "conclusion" ], "additionalProperties": true