From 1c0348534b08f11f4dab64e4e051251d3c1ddc78 Mon Sep 17 00:00:00 2001 From: Riadh Laabidi Date: Wed, 19 Oct 2022 14:37:51 +0000 Subject: [PATCH 1/7] Add workflow_dispatch event with write permissions --- content/rest/overview/permissions-required-for-github-apps.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/rest/overview/permissions-required-for-github-apps.md b/content/rest/overview/permissions-required-for-github-apps.md index 67ed185aab..74a8b4d46f 100644 --- a/content/rest/overview/permissions-required-for-github-apps.md +++ b/content/rest/overview/permissions-required-for-github-apps.md @@ -140,6 +140,7 @@ If you set the metadata permission to **No access** and select a permission that - [`GET /repos/:owner/:repo/actions/workflows`](/rest/reference/actions#list-repository-workflows) (read) - [`GET /repos/:owner/:repo/actions/workflows/:workflow_id`](/rest/reference/actions#get-a-workflow) (read) - [`GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs`](/rest/reference/actions#list-workflow-runs) (read) +- [`POST /repos/:owner/:repo/actions/workflows/:workflow_id/dispatches`](/rest/reference/actions#create-a-workflow-dispatch-event) (write) {% endif %} ## Administration From 97cc0eb572f4d2b6046fff9fe07d5fdde9940862 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 25 Oct 2022 22:05:50 +0200 Subject: [PATCH 2/7] only render product_video when needed (#32048) --- components/context/ProductLandingContext.tsx | 21 ++++++++++---------- components/landing/LandingHero.tsx | 8 ++++---- lib/page.js | 3 --- pages/[versionId]/[productId]/index.tsx | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/components/context/ProductLandingContext.tsx b/components/context/ProductLandingContext.tsx index b21c768e2a..72b045f7a5 100644 --- a/components/context/ProductLandingContext.tsx +++ b/components/context/ProductLandingContext.tsx @@ -39,7 +39,7 @@ export type ProductLandingContextT = { beta_product: boolean product: Product introLinks: Record | null - product_video?: string + productVideo: string featuredLinks: Record> productCodeExamples: Array productUserExamples: Array<{ username: string; description: string }> @@ -93,19 +93,20 @@ export const getFeaturedLinksFromReq = (req: any): Record { +export const getProductLandingContextFromRequest = async ( + req: any +): Promise => { const productTree = req.context.currentProductTree const page = req.context.page const hasGuidesPage = (page.children || []).includes('/guides') + + const productVideo = page.product_video + ? await page.renderProp('product_video', req.context, { textOnly: true }) + : '' + return { - ...pick(page, [ - 'title', - 'shortTitle', - 'introPlainText', - 'beta_product', - 'intro', - 'product_video', - ]), + ...pick(page, ['title', 'shortTitle', 'introPlainText', 'beta_product', 'intro']), + productVideo, hasGuidesPage, product: { href: productTree.href, diff --git a/components/landing/LandingHero.tsx b/components/landing/LandingHero.tsx index f9e8e19004..7b6442fe55 100644 --- a/components/landing/LandingHero.tsx +++ b/components/landing/LandingHero.tsx @@ -10,7 +10,7 @@ import { useVersion } from 'components/hooks/useVersion' import { Lead } from 'components/ui/Lead' export const LandingHero = () => { - const { product_video, shortTitle, title, beta_product, intro, introLinks } = + const { productVideo, shortTitle, title, beta_product, intro, introLinks } = useProductLandingContext() const { t } = useTranslation('product_landing') const [renderIFrame, setRenderIFrame] = useState(false) @@ -22,7 +22,7 @@ export const LandingHero = () => { return (
-
+

{shortTitle || title}{' '} {beta_product && Beta} @@ -51,13 +51,13 @@ export const LandingHero = () => { })}

- {product_video && ( + {productVideo && (