From c622faf6360b061fade89a1661e0f23b1018790a Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Fri, 19 Nov 2021 14:19:13 -0500 Subject: [PATCH 1/2] effectiveDate might be falsy (#23002) Part of #1185 --- middleware/render-page.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/middleware/render-page.js b/middleware/render-page.js index 1fe891d68c..a082920d6a 100644 --- a/middleware/render-page.js +++ b/middleware/render-page.js @@ -34,7 +34,10 @@ export default async function renderPage(req, res, next) { // Updating the Last-Modified header for substantive changes on a page for engineering // Docs Engineering Issue #945 - if (context.page.effectiveDate !== '') { + if (context.page.effectiveDate) { + // Note that if a page has an invalidate `effectiveDate` string value, + // it would be caught prior to this usage and ultimately lead to + // 500 error. res.setHeader('Last-Modified', new Date(context.page.effectiveDate).toUTCString()) } From 37304679c4471af2b26d364678efd24cb7695ee7 Mon Sep 17 00:00:00 2001 From: Marcelo Jacobus Date: Fri, 19 Nov 2021 16:26:52 -0300 Subject: [PATCH 2/2] Fix error in CI (#23014) See this this discussion: https://github.slack.com/archives/C0128FB8J3H/p1637330143039300 ``` Run echo "$GITHUB_CONTEXT" # Error: Argument list too long ``` --- .github/workflows/staging-build-pr.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/staging-build-pr.yml b/.github/workflows/staging-build-pr.yml index 50f050f9cc..5233e85ffe 100644 --- a/.github/workflows/staging-build-pr.yml +++ b/.github/workflows/staging-build-pr.yml @@ -34,9 +34,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Dump full context for debugging - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - run: echo "$GITHUB_CONTEXT" + run: | + cat << EOF + ${{ toJSON(github) }} + EOF build-pr: if: ${{ github.repository == 'github/docs-internal' || github.repository == 'github/docs' }}