From 6d3b76a72677c8b531c883a065fe98f97bf919f4 Mon Sep 17 00:00:00 2001 From: docs-bot <77750099+docs-bot@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:47:03 -0700 Subject: [PATCH 1/2] Repo sync (#33561) Co-authored-by: Peter Bengtsson Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Co-authored-by: Chad Fawcett --- .../setting-up-the-codeql-cli.md | 18 +++-------- .../advanced-setup-of-the-codeql-cli.md | 16 +++------- ...deql-cli-zip.md => download-codeql-cli.md} | 4 ++- src/audit-logs/data/ghes-3.14/enterprise.json | 5 +++ src/audit-logs/lib/config.json | 2 +- .../context/{glossaries.js => glossaries.ts} | 32 ++++++++++++------- src/frame/middleware/index.ts | 2 +- .../tests/{glossary.js => glossary.ts} | 4 +-- src/types.ts | 6 ++++ 9 files changed, 47 insertions(+), 42 deletions(-) rename data/reusables/codeql-cli/{download-codeql-cli-zip.md => download-codeql-cli.md} (65%) rename src/frame/middleware/context/{glossaries.js => glossaries.ts} (73%) rename src/languages/tests/{glossary.js => glossary.ts} (79%) diff --git a/content/code-security/codeql-cli/getting-started-with-the-codeql-cli/setting-up-the-codeql-cli.md b/content/code-security/codeql-cli/getting-started-with-the-codeql-cli/setting-up-the-codeql-cli.md index d99daf8eb702..408f311e6e25 100644 --- a/content/code-security/codeql-cli/getting-started-with-the-codeql-cli/setting-up-the-codeql-cli.md +++ b/content/code-security/codeql-cli/getting-started-with-the-codeql-cli/setting-up-the-codeql-cli.md @@ -41,23 +41,13 @@ tools](https://developer.apple.com/downloads/index.action) and [Rosetta 2](https {% endnote %} -### 1. Download the {% data variables.product.prodname_codeql_cli %} zip package +### 1. Download the {% data variables.product.prodname_codeql_cli %} tar archive -{% data reusables.codeql-cli.download-codeql-cli-zip %} +{% data reusables.codeql-cli.download-codeql-cli %} -You should always use the {% data variables.product.prodname_codeql %} bundle as this ensures compatibility and also gives much better performance than a separate download of the {% data variables.product.prodname_codeql_cli %} and checkout of the {% data variables.product.prodname_codeql %} queries. If you will only be running the CLI on one specific platform, download the appropriate `codeql-bundle-PLATFORM.tar.gz` file. Alternatively, you can download `codeql-bundle.tar.gz`, which contains the CLI for all supported platforms. +### 2. Extract the {% data variables.product.prodname_codeql_cli %} tar archive -#### Download information for macOS "Catalina" (or newer) users - -{% data reusables.codeql-cli.download-info-macos-catalina-or-newer %} - -### 2. Extract the zip archive - -For Linux, Windows, and macOS users (version 10.14 "Mojave", and earlier) simply extract the zip archive. - -#### Extraction information for macOS "Catalina" (or newer) users - -{% data reusables.codeql-cli.extraction-info-macos-catalina-or-newer %} +Extract the {% data variables.product.prodname_codeql_cli %} tar archive to a directory of your choosing. ### 3. Launch `codeql` diff --git a/content/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/advanced-setup-of-the-codeql-cli.md b/content/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/advanced-setup-of-the-codeql-cli.md index ae92dffea2df..31caa60e9fe2 100644 --- a/content/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/advanced-setup-of-the-codeql-cli.md +++ b/content/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/advanced-setup-of-the-codeql-cli.md @@ -26,13 +26,9 @@ For information on the most simple setup of the {% data variables.product.prodna Some users prefer working with {% data variables.product.prodname_codeql %} query sources directly in order to work on or contribute to the Open Source shared queries. In order to do this, the following steps are recommended. -### 1. Download the {% data variables.product.prodname_codeql_cli %} zip +### 1. Download the {% data variables.product.prodname_codeql_cli %} tar archive -{% data reusables.codeql-cli.download-codeql-cli-zip %} - -#### Download information for macOS "Catalina" (or newer) users - -{% data reusables.codeql-cli.download-info-macos-catalina-or-newer %} +{% data reusables.codeql-cli.download-codeql-cli %} ### 2. Create a new {% data variables.product.prodname_codeql %} directory @@ -73,17 +69,13 @@ see "[AUTOTITLE](/code-security/codeql-cli/using-the-advanced-functionality-of-t {% endnote %} -### 4. Extract the zip archive +### 4. Extract the {% data variables.product.prodname_codeql_cli %} tar archive -For Linux, Windows, and macOS users (version 10.14 "Mojave", and earlier) simply extract the zip archive into the directory you created in step 2. +Extract the tar archive into the directory you created in step 2. For example, if the path to your copy of the {% data variables.product.prodname_codeql %} repository is `$HOME/codeql-home/codeql-repo`, then extract the CLI into `$HOME/codeql-home/`. -#### Extraction information for macOS "Catalina" (or newer) users - -{% data reusables.codeql-cli.extraction-info-macos-catalina-or-newer %} - ### 5. Launch `codeql` {% data reusables.codeql-cli.launch-codeql %} diff --git a/data/reusables/codeql-cli/download-codeql-cli-zip.md b/data/reusables/codeql-cli/download-codeql-cli.md similarity index 65% rename from data/reusables/codeql-cli/download-codeql-cli-zip.md rename to data/reusables/codeql-cli/download-codeql-cli.md index c3f737c1845f..bd7a9e1dbab1 100644 --- a/data/reusables/codeql-cli/download-codeql-cli-zip.md +++ b/data/reusables/codeql-cli/download-codeql-cli.md @@ -1,4 +1,4 @@ -The {% data variables.product.prodname_codeql_cli %} download package is a zip archive containing tools, scripts, and +The {% data variables.product.prodname_codeql_cli %} download package is a tar archive containing tools, scripts, and various {% data variables.product.prodname_codeql %}-specific files. If you don’t have a {% data variables.product.prodname_enterprise %} license then, by downloading this archive, you are agreeing to the [{% data variables.product.prodname_dotcom %} {% data variables.product.prodname_codeql %} Terms and Conditions](https://securitylab.github.com/tools/codeql/license). @@ -16,3 +16,5 @@ For {% data variables.product.product_name %}{% ifversion ghes %} {{ allVersions {% endnote %} {% endif %} + +You should always use the {% data variables.product.prodname_codeql %} bundle as this ensures compatibility and also gives much better performance than a separate download of the {% data variables.product.prodname_codeql_cli %} and checkout of the {% data variables.product.prodname_codeql %} queries. If you will only be running the CLI on one specific platform, download the appropriate `codeql-bundle-PLATFORM.tar.gz` file. Alternatively, you can download `codeql-bundle.tar.gz`, which contains the CLI for all supported platforms. diff --git a/src/audit-logs/data/ghes-3.14/enterprise.json b/src/audit-logs/data/ghes-3.14/enterprise.json index 5c31961c9845..9c8c349d795d 100644 --- a/src/audit-logs/data/ghes-3.14/enterprise.json +++ b/src/audit-logs/data/ghes-3.14/enterprise.json @@ -224,6 +224,11 @@ "description": "The slug for the enterprise URL was renamed.", "docs_reference_links": "N/A" }, + { + "action": "business.revoke_sso_session", + "description": "The SAML single sign-on session for a member in an enterprise was revoked.", + "docs_reference_links": "N/A" + }, { "action": "business_secret_scanning_automatic_validity_checks.disabled", "description": "Automatic partner validation checks have been disabled at the business level", diff --git a/src/audit-logs/lib/config.json b/src/audit-logs/lib/config.json index d16851f9776e..e601411e0bc0 100644 --- a/src/audit-logs/lib/config.json +++ b/src/audit-logs/lib/config.json @@ -3,5 +3,5 @@ "apiOnlyEvents": "This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.", "apiRequestEvent": "This event is only available via audit log streaming." }, - "sha": "85a279c15cbe907d055830214c1ee9320fbfd9ea" + "sha": "476743b7f0d4adcd4b825fb00ce54b76b2d623b5" } \ No newline at end of file diff --git a/src/frame/middleware/context/glossaries.js b/src/frame/middleware/context/glossaries.ts similarity index 73% rename from src/frame/middleware/context/glossaries.js rename to src/frame/middleware/context/glossaries.ts index 99b34ddfafb2..66c84ea78ee8 100644 --- a/src/frame/middleware/context/glossaries.js +++ b/src/frame/middleware/context/glossaries.ts @@ -1,11 +1,17 @@ -import { getDataByLanguage } from '#src/data-directory/lib/get-data.js' -import { liquid } from '#src/content-render/index.js' -import { executeWithFallback } from '#src/languages/lib/render-with-fallback.js' -import { correctTranslatedContentStrings } from '#src/languages/lib/correct-translation-content.js' +import type { Response, NextFunction } from 'express' -export default async function glossaries(req, res, next) { +import type { Context, ExtendedRequest, Glossary } from '@/types' +import { getDataByLanguage } from '@/data-directory/lib/get-data.js' +import { liquid } from '@/content-render/index.js' +import { executeWithFallback } from '@/languages/lib/render-with-fallback.js' +import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content.js' + +export default async function glossaries(req: ExtendedRequest, res: Response, next: NextFunction) { + if (!req.pagePath) throw new Error('request is not contextualized') if (!req.pagePath.endsWith('/get-started/learning-about-github/github-glossary')) return next() + if (!req.context) throw new Error('request is not contextualized') + // If the current version (which is found as part of the URL), does not // correspond to a supported version, the Liquid rendering will fail // (if there's uses of `ifversion` in any the Liquid). @@ -19,7 +25,8 @@ export default async function glossaries(req, res, next) { const enGlossaryMap = new Map() // But we don't need to bother if the current language is English. if (req.context.currentLanguage !== 'en') { - const enGlossariesRaw = getDataByLanguage('glossaries.external', 'en') + const enGlossariesRaw: Glossary[] = getDataByLanguage('glossaries.external', 'en') + enGlossariesRaw.forEach(({ term, description }) => { enGlossaryMap.set(term, description) }) @@ -30,12 +37,15 @@ export default async function glossaries(req, res, next) { // The github-glossary.md file uses Liquid to generate the Markdown. // It uses Liquid to say `{{ glossary.description }}` but once that's // injected there it needs to have its own possible Liquid rendered out. - const glossariesRaw = getDataByLanguage('glossaries.external', req.context.currentLanguage) + const glossariesRaw: Glossary[] = getDataByLanguage( + 'glossaries.external', + req.context.currentLanguage, + ) const glossaries = ( await Promise.all( glossariesRaw.map(async (glossary) => { let { description } = glossary - if (req.context.currentLanguage !== 'en') { + if (req.context!.currentLanguage !== 'en') { description = correctTranslatedContentStrings( description, // The function needs the English equivalent of the translated @@ -46,13 +56,13 @@ export default async function glossaries(req, res, next) { // in this mapping we often don't have an English equivalent. // So that's why we fall back on the empty string. enGlossaryMap.get(glossary.term) || '', - { code: req.context.currentLanguage }, + { code: req.context!.currentLanguage }, ) } description = await executeWithFallback( req.context, () => liquid.parseAndRender(description, req.context), - (enContext) => { + (enContext: Context) => { const { term } = glossary // It *could* be that the translation is referring to a term // that no longer exists in the English glossary. In that case, @@ -71,7 +81,7 @@ export default async function glossaries(req, res, next) { ).filter(Boolean) req.context.glossaries = glossaries.sort((a, b) => - a.term.localeCompare(b.term, req.context.currentLanguage), + a.term.localeCompare(b.term, req.context!.currentLanguage), ) return next() diff --git a/src/frame/middleware/index.ts b/src/frame/middleware/index.ts index 756c0a032219..3a4a1bd0f1fd 100644 --- a/src/frame/middleware/index.ts +++ b/src/frame/middleware/index.ts @@ -43,7 +43,7 @@ import layout from './context/layout' import currentProductTree from './context/current-product-tree' import genericToc from './context/generic-toc' import breadcrumbs from './context/breadcrumbs' -import glossaries from './context/glossaries.js' +import glossaries from './context/glossaries' import renderProductName from './context/render-product-name.js' import features from '@/versions/middleware/features.js' import productExamples from './context/product-examples.js' diff --git a/src/languages/tests/glossary.js b/src/languages/tests/glossary.ts similarity index 79% rename from src/languages/tests/glossary.js rename to src/languages/tests/glossary.ts index 30538a0cbe75..14c9a83f735f 100644 --- a/src/languages/tests/glossary.js +++ b/src/languages/tests/glossary.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { languageKeys } from '#src/languages/lib/languages.js' -import { getDOM } from '#src/tests/helpers/e2etest.js' +import { languageKeys } from '@/languages/lib/languages.js' +import { getDOM } from '@/tests/helpers/e2etest.js' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/types.ts b/src/types.ts index 8b69f3ef6b62..5c7b0418cbb8 100644 --- a/src/types.ts +++ b/src/types.ts @@ -91,6 +91,12 @@ export type Context = { genericTocFlat?: ToC[] genericTocNested?: ToC[] breadcrumbs?: Breadcrumb[] + glossaries?: Glossary[] +} + +export type Glossary = { + term: string + description: string } type Breadcrumb = { From ef2e8cc2014fde5d87703258036897aba581384b Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 18 Jun 2024 17:08:08 -0400 Subject: [PATCH 2/2] Remove use of 'actions-cache-org-ui' feature version (#33554) Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com> --- ...abling-or-limiting-github-actions-for-your-organization.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/content/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization.md b/content/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization.md index 9b9172860eae..78e488a0015c 100644 --- a/content/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization.md +++ b/content/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization.md @@ -198,8 +198,6 @@ By default, when you create a new organization, workflows are not allowed to {% {% endif %} -{% ifversion actions-cache-org-ui %} - ## Managing {% data variables.product.prodname_actions %} cache storage for your organization Organization administrators can view {% ifversion actions-cache-admin-ui %}and manage {% endif %}{% data variables.product.prodname_actions %} cache storage for all repositories in the organization. @@ -229,5 +227,3 @@ You can configure the size limit for {% data variables.product.prodname_actions {% data reusables.actions.change-cache-size-limit %} {% endif %} - -{% endif %}