From d85ad47a9f38a7fb7d30276f38bb83bdc4719a21 Mon Sep 17 00:00:00 2001 From: katiegoines Date: Fri, 7 Jun 2024 13:53:50 -0700 Subject: [PATCH 1/6] add workflow to validate redirects --- .github/workflows/check_redirect_validity.yml | 40 ++++++++++++++ package.json | 4 +- redirects.json | 6 +-- tasks/validate-redirects.mjs | 54 +++++++++++++++++++ yarn.lock | 43 +++++++++++++-- 5 files changed, 139 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/check_redirect_validity.yml create mode 100644 tasks/validate-redirects.mjs diff --git a/.github/workflows/check_redirect_validity.yml b/.github/workflows/check_redirect_validity.yml new file mode 100644 index 00000000000..5efccf8151e --- /dev/null +++ b/.github/workflows/check_redirect_validity.yml @@ -0,0 +1,40 @@ +name: ValidateRedirects +on: + pull_request: + branches: [main] + types: [opened, synchronize] +env: + BUILD_DIR: 'client/www/next-build' +permissions: + contents: read +jobs: + CheckConsoleErrors: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Setup Node.js 20.x + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: 20.x + - name: Install Dependencies + run: yarn + - name: Run Build + run: yarn build:release + env: + NODE_OPTIONS: --max_old_space_size=4096 + - name: Run Server + run: | + python -m http.server 3000 -d ${{ env.BUILD_DIR }} & + sleep 5 + - name: Validate redirects + id: redirects + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + result-encoding: string + script: | + const { redirects } = require('./tasks/validate_redirects'); + return await invalidRedirects(); + - name: Fail if console errors have been found + if: ${{ steps.redirects.outputs.result }} + run: exit 1 diff --git a/package.json b/package.json index 0b9be3fd3fd..0053f4a99d8 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@aws-amplify/amplify-cli-core": "^4.3.6", "@aws-amplify/ui-react": "^6.1.12", "@docsearch/react": "3", + "ajv": "^8.16.0", "aws-amplify": "^6.0.9", "next": "^14.2.3", "next-image-export-optimizer": "^1.8.3", @@ -111,6 +112,7 @@ "prepare": "husky install", "analyze": "ANALYZE=true yarn next-build", "prebuild": "node src/directory/generateDirectory.mjs && node src/directory/generateFlatDirectory.mjs", - "lint": "next lint" + "lint": "next lint", + "validate-redirects": "node tasks/validate-redirects.mjs" } } diff --git a/redirects.json b/redirects.json index 9d74a7b3294..79ab08fb6fb 100644 --- a/redirects.json +++ b/redirects.json @@ -12,10 +12,10 @@ { "source": "/lib/ssr/ssr/", "target": "/gen1/javascript/prev/build-a-backend/server-side-rendering/", - "status": "301" + "status": "606" }, { - "source": "/cli/plugins/", + "source": "cli/plugins/", "target": "/javascript/tools/cli/plugins/", "status": "301" }, @@ -3011,7 +3011,7 @@ }, { "source": "/lib/client-configuration/configuring-amplify-categories/q/platform/react-native/", - "target": "react-native/tools/libraries/configure-categories/", + "target": "/react-native/tools/libraries/configure-categories/", "status": "301" }, { diff --git a/tasks/validate-redirects.mjs b/tasks/validate-redirects.mjs new file mode 100644 index 00000000000..d98dd22076b --- /dev/null +++ b/tasks/validate-redirects.mjs @@ -0,0 +1,54 @@ +import Ajv from 'ajv'; +import * as redirects from '../redirects.json' assert { type: 'json' }; +const ajv = new Ajv({ formats: { 'uri-reference': true }, strict: false }); + +const schema = { + type: 'array', + items: { + type: 'object', + required: ['source', 'target', 'status'], + properties: { + source: { + description: 'The address the user requested.', + type: 'string', + pattern: '^/' + }, + target: { + description: + 'The address that actually serves the content that the user sees', + type: 'string', + format: 'uri-reference', + pattern: '^[(https)(/)]' + }, + status: { + description: + 'Types include a permanent redirect (301), a temporary redirect (302), a rewrite (200), or not found (404).', + type: 'string', + pattern: '^[0-5-]+$' + } + } + } +}; + +const validate = ajv.compile(schema); + +const valid = validate(redirects.default); +if (!valid) { + const invalidEntry = + redirects.default[validate.errors[0].instancePath.slice(1, -7)]; + const loc = validate.errors[0].schemaPath; + const error = loc.slice(loc.indexOf('properties') + 11, -8); + + console.log( + 'Please correct the error in the "' + + error + + '" property of the following entry:' + ); + console.log(invalidEntry); +} + +module.exports = { + invalidRedirects: () => { + return true; + } +}; diff --git a/yarn.lock b/yarn.lock index 13a9208c505..44ee06caaf7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3442,6 +3442,16 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" +ajv@^8.16.0: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4" + integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw== + dependencies: + fast-deep-equal "^3.1.3" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.4.1" + algoliasearch@^4.19.1: version "4.22.1" resolved "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.22.1.tgz" @@ -10343,7 +10353,16 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -10427,7 +10446,14 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -11160,7 +11186,7 @@ upper-case@^2.0.2: dependencies: tslib "^2.0.3" -uri-js@^4.2.2: +uri-js@^4.2.2, uri-js@^4.4.1: version "4.4.1" resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== @@ -11508,7 +11534,7 @@ winston@^3.3.3: triple-beam "^1.3.0" winston-transport "^4.5.0" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -11526,6 +11552,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" From 1c02da78c01c41ceb8818239612e2fb3b71349d4 Mon Sep 17 00:00:00 2001 From: katiegoines Date: Fri, 7 Jun 2024 13:54:23 -0700 Subject: [PATCH 2/6] change filename --- .../workflows/scripts/validate-redirects.js | 49 +++++++++++++++++ ...ct_validity.yml => validate_redirects.yml} | 18 ++----- package.json | 3 +- redirects.json | 4 +- tasks/validate-redirects.mjs | 54 ------------------- 5 files changed, 57 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/scripts/validate-redirects.js rename .github/workflows/{check_redirect_validity.yml => validate_redirects.yml} (65%) delete mode 100644 tasks/validate-redirects.mjs diff --git a/.github/workflows/scripts/validate-redirects.js b/.github/workflows/scripts/validate-redirects.js new file mode 100644 index 00000000000..de7df56a556 --- /dev/null +++ b/.github/workflows/scripts/validate-redirects.js @@ -0,0 +1,49 @@ +module.exports = { + invalidRedirects: () => { + const Ajv = require('ajv'); + const redirects = require('../../../redirects.json'); + const ajv = new Ajv(); + + const schema = { + type: 'array', + items: { + type: 'object', + required: ['source', 'target', 'status'], + properties: { + source: { + description: 'The address the user requested.', + type: 'string', + pattern: '^/' + }, + target: { + description: + 'The address that actually serves the content that the user sees', + type: 'string', + pattern: '^[(https)(/)]' + }, + status: { + description: + 'Types include a permanent redirect (301), a temporary redirect (302), a rewrite (200), or not found (404).', + type: 'string', + pattern: '^[0-5-]+$' + } + } + } + }; + + const validate = ajv.compile(schema); + + const valid = validate(redirects); + if (!valid) { + const invalidEntry = + JSON.stringify(redirects[validate.errors[0].instancePath.slice(1, -7)]); + const error = validate.errors[0]; + const loc = error.schemaPath.slice(error.schemaPath.indexOf('properties') + 11, -8); + + const errorMessage = '\n\n' + 'INVALID ENTRY: Please correct the error in the "' + loc +'" property of the following entry: \n' + invalidEntry + '\n\n' + 'ERROR MESSAGE: ' + error.message; + return errorMessage; + } + } +} + + diff --git a/.github/workflows/check_redirect_validity.yml b/.github/workflows/validate_redirects.yml similarity index 65% rename from .github/workflows/check_redirect_validity.yml rename to .github/workflows/validate_redirects.yml index 5efccf8151e..e37598b26c2 100644 --- a/.github/workflows/check_redirect_validity.yml +++ b/.github/workflows/validate_redirects.yml @@ -1,4 +1,4 @@ -name: ValidateRedirects +name: Validate Redirects on: pull_request: branches: [main] @@ -8,7 +8,7 @@ env: permissions: contents: read jobs: - CheckConsoleErrors: + ValidateRedirects: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -19,22 +19,14 @@ jobs: node-version: 20.x - name: Install Dependencies run: yarn - - name: Run Build - run: yarn build:release - env: - NODE_OPTIONS: --max_old_space_size=4096 - - name: Run Server - run: | - python -m http.server 3000 -d ${{ env.BUILD_DIR }} & - sleep 5 - name: Validate redirects id: redirects uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: result-encoding: string script: | - const { redirects } = require('./tasks/validate_redirects'); + const { invalidRedirects } = require('./.github/workflows/scripts/validate-redirects.js'); return await invalidRedirects(); - - name: Fail if console errors have been found + - name: Fail if any invalid redirects have been found if: ${{ steps.redirects.outputs.result }} - run: exit 1 + run: exit 1 && echo ${{ steps.redirects.outputs.result }} diff --git a/package.json b/package.json index 0053f4a99d8..fb49c1afb6f 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,6 @@ "prepare": "husky install", "analyze": "ANALYZE=true yarn next-build", "prebuild": "node src/directory/generateDirectory.mjs && node src/directory/generateFlatDirectory.mjs", - "lint": "next lint", - "validate-redirects": "node tasks/validate-redirects.mjs" + "lint": "next lint" } } diff --git a/redirects.json b/redirects.json index 79ab08fb6fb..ac28621fccd 100644 --- a/redirects.json +++ b/redirects.json @@ -12,12 +12,12 @@ { "source": "/lib/ssr/ssr/", "target": "/gen1/javascript/prev/build-a-backend/server-side-rendering/", - "status": "606" + "status": "301" }, { "source": "cli/plugins/", "target": "/javascript/tools/cli/plugins/", - "status": "301" + "status": "601" }, { "source": "/<*>", diff --git a/tasks/validate-redirects.mjs b/tasks/validate-redirects.mjs deleted file mode 100644 index d98dd22076b..00000000000 --- a/tasks/validate-redirects.mjs +++ /dev/null @@ -1,54 +0,0 @@ -import Ajv from 'ajv'; -import * as redirects from '../redirects.json' assert { type: 'json' }; -const ajv = new Ajv({ formats: { 'uri-reference': true }, strict: false }); - -const schema = { - type: 'array', - items: { - type: 'object', - required: ['source', 'target', 'status'], - properties: { - source: { - description: 'The address the user requested.', - type: 'string', - pattern: '^/' - }, - target: { - description: - 'The address that actually serves the content that the user sees', - type: 'string', - format: 'uri-reference', - pattern: '^[(https)(/)]' - }, - status: { - description: - 'Types include a permanent redirect (301), a temporary redirect (302), a rewrite (200), or not found (404).', - type: 'string', - pattern: '^[0-5-]+$' - } - } - } -}; - -const validate = ajv.compile(schema); - -const valid = validate(redirects.default); -if (!valid) { - const invalidEntry = - redirects.default[validate.errors[0].instancePath.slice(1, -7)]; - const loc = validate.errors[0].schemaPath; - const error = loc.slice(loc.indexOf('properties') + 11, -8); - - console.log( - 'Please correct the error in the "' + - error + - '" property of the following entry:' - ); - console.log(invalidEntry); -} - -module.exports = { - invalidRedirects: () => { - return true; - } -}; From 6bf85ff21ea54c3c85968dc42978651bfc2f7e4e Mon Sep 17 00:00:00 2001 From: katiegoines Date: Fri, 7 Jun 2024 17:10:03 -0700 Subject: [PATCH 3/6] removing testing errors --- redirects.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redirects.json b/redirects.json index ac28621fccd..1655fdaae20 100644 --- a/redirects.json +++ b/redirects.json @@ -15,9 +15,9 @@ "status": "301" }, { - "source": "cli/plugins/", + "source": "/cli/plugins/", "target": "/javascript/tools/cli/plugins/", - "status": "601" + "status": "301" }, { "source": "/<*>", From 9ece25e048dd90dbb1cf4da80f35aa05e5e21e39 Mon Sep 17 00:00:00 2001 From: katiegoines Date: Mon, 10 Jun 2024 09:33:24 -0700 Subject: [PATCH 4/6] finding all invalid redirects --- .../workflows/scripts/validate-redirects.js | 32 +++++++++++++------ .github/workflows/validate_redirects.yml | 2 +- redirects.json | 4 +-- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/scripts/validate-redirects.js b/.github/workflows/scripts/validate-redirects.js index de7df56a556..14050bf01d3 100644 --- a/.github/workflows/scripts/validate-redirects.js +++ b/.github/workflows/scripts/validate-redirects.js @@ -1,7 +1,7 @@ module.exports = { invalidRedirects: () => { const Ajv = require('ajv'); - const redirects = require('../../../redirects.json'); + const redirectsImport = require('../../../redirects.json'); const ajv = new Ajv(); const schema = { @@ -31,18 +31,30 @@ module.exports = { } }; - const validate = ajv.compile(schema); + let redirects = redirectsImport; + const errors = []; - const valid = validate(redirects); - if (!valid) { - const invalidEntry = - JSON.stringify(redirects[validate.errors[0].instancePath.slice(1, -7)]); - const error = validate.errors[0]; - const loc = error.schemaPath.slice(error.schemaPath.indexOf('properties') + 11, -8); + const validateEntries = (redirects) => { + const validate = ajv.compile(schema); + const valid = validate(redirects); - const errorMessage = '\n\n' + 'INVALID ENTRY: Please correct the error in the "' + loc +'" property of the following entry: \n' + invalidEntry + '\n\n' + 'ERROR MESSAGE: ' + error.message; - return errorMessage; + if (!valid) { + const error = validate.errors[0]; + const invalidEntry = + JSON.stringify(redirects[error.instancePath.slice(1, -7)]); + const loc = error.schemaPath.slice(error.schemaPath.indexOf('properties') + 11, -8); + const errorMessage = '\n\n' + 'INVALID ENTRY: Please correct the error in the "' + loc +'" property of the following entry: \n' + invalidEntry + '\n\n' + 'ERROR MESSAGE: ' + error.message; + + errors.push(errorMessage) + redirects = redirects.splice(error.instancePath.slice(1, -7)) + + validateEntries(redirects) + } else if (valid && errors.length > 0) { + return errors.stringify(); + } } + + validateEntries(redirects); } } diff --git a/.github/workflows/validate_redirects.yml b/.github/workflows/validate_redirects.yml index e37598b26c2..83b7f11f7b2 100644 --- a/.github/workflows/validate_redirects.yml +++ b/.github/workflows/validate_redirects.yml @@ -28,5 +28,5 @@ jobs: const { invalidRedirects } = require('./.github/workflows/scripts/validate-redirects.js'); return await invalidRedirects(); - name: Fail if any invalid redirects have been found - if: ${{ steps.redirects.outputs.result }} + if: ${{ steps.redirects.outputs.result != 'undefined' }} run: exit 1 && echo ${{ steps.redirects.outputs.result }} diff --git a/redirects.json b/redirects.json index 1655fdaae20..13a49bd92e5 100644 --- a/redirects.json +++ b/redirects.json @@ -5,14 +5,14 @@ "status": "301" }, { - "source": "/cli/function/function/", + "source": "cli/function/function/", "target": "/javascript/build-a-backend/functions/set-up-function/", "status": "301" }, { "source": "/lib/ssr/ssr/", "target": "/gen1/javascript/prev/build-a-backend/server-side-rendering/", - "status": "301" + "status": "601" }, { "source": "/cli/plugins/", From 685f0cad78c95117693fa90cc90e0242700eab68 Mon Sep 17 00:00:00 2001 From: katiegoines Date: Mon, 10 Jun 2024 09:37:15 -0700 Subject: [PATCH 5/6] running validation to catch all issues --- .../workflows/check_pr_for_broken_links.yml | 2 +- .../workflows/scripts/validate-redirects.js | 23 ++++++++----------- .github/workflows/validate_redirects.yml | 2 +- redirects.json | 4 ++-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check_pr_for_broken_links.yml b/.github/workflows/check_pr_for_broken_links.yml index 24a9f7e6f38..83ea39c0cf8 100644 --- a/.github/workflows/check_pr_for_broken_links.yml +++ b/.github/workflows/check_pr_for_broken_links.yml @@ -35,4 +35,4 @@ jobs: return await checkDevLinks(); - name: Fail if broken links have been found if: ${{ steps.checkLinks.outputs.result }} - run: exit 1 + run: exit 1 && echo ${{ toJson(steps.checkLinks.outputs.result) }} diff --git a/.github/workflows/scripts/validate-redirects.js b/.github/workflows/scripts/validate-redirects.js index 14050bf01d3..de89c1e3802 100644 --- a/.github/workflows/scripts/validate-redirects.js +++ b/.github/workflows/scripts/validate-redirects.js @@ -1,7 +1,7 @@ module.exports = { invalidRedirects: () => { const Ajv = require('ajv'); - const redirectsImport = require('../../../redirects.json'); + const redirects = require('../../../redirects.json'); const ajv = new Ajv(); const schema = { @@ -31,11 +31,10 @@ module.exports = { } }; - let redirects = redirectsImport; const errors = []; + const validate = ajv.compile(schema); const validateEntries = (redirects) => { - const validate = ajv.compile(schema); const valid = validate(redirects); if (!valid) { @@ -43,18 +42,16 @@ module.exports = { const invalidEntry = JSON.stringify(redirects[error.instancePath.slice(1, -7)]); const loc = error.schemaPath.slice(error.schemaPath.indexOf('properties') + 11, -8); - const errorMessage = '\n\n' + 'INVALID ENTRY: Please correct the error in the "' + loc +'" property of the following entry: \n' + invalidEntry + '\n\n' + 'ERROR MESSAGE: ' + error.message; - - errors.push(errorMessage) - redirects = redirects.splice(error.instancePath.slice(1, -7)) - - validateEntries(redirects) - } else if (valid && errors.length > 0) { - return errors.stringify(); - } - } + const errorMessage = '\n\n' + 'INVALID ENTRY: Please correct the error in the "' + loc +'" property of the following entry: \n' + invalidEntry + '\n' + 'ERROR MESSAGE: ' + error.message; + errors.push(errorMessage); + + validateEntries(redirects.splice(parseInt(error.instancePath.slice(1, -7)) + 1)); + } + } validateEntries(redirects); + + return errors; } } diff --git a/.github/workflows/validate_redirects.yml b/.github/workflows/validate_redirects.yml index 83b7f11f7b2..e37598b26c2 100644 --- a/.github/workflows/validate_redirects.yml +++ b/.github/workflows/validate_redirects.yml @@ -28,5 +28,5 @@ jobs: const { invalidRedirects } = require('./.github/workflows/scripts/validate-redirects.js'); return await invalidRedirects(); - name: Fail if any invalid redirects have been found - if: ${{ steps.redirects.outputs.result != 'undefined' }} + if: ${{ steps.redirects.outputs.result }} run: exit 1 && echo ${{ steps.redirects.outputs.result }} diff --git a/redirects.json b/redirects.json index 13a49bd92e5..1655fdaae20 100644 --- a/redirects.json +++ b/redirects.json @@ -5,14 +5,14 @@ "status": "301" }, { - "source": "cli/function/function/", + "source": "/cli/function/function/", "target": "/javascript/build-a-backend/functions/set-up-function/", "status": "301" }, { "source": "/lib/ssr/ssr/", "target": "/gen1/javascript/prev/build-a-backend/server-side-rendering/", - "status": "601" + "status": "301" }, { "source": "/cli/plugins/", From 0c3113bcac7e930151999c2bfde9ed744beb8c97 Mon Sep 17 00:00:00 2001 From: katiegoines Date: Mon, 10 Jun 2024 12:52:45 -0700 Subject: [PATCH 6/6] remove unneeded code --- .github/workflows/check_pr_for_broken_links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_pr_for_broken_links.yml b/.github/workflows/check_pr_for_broken_links.yml index 83ea39c0cf8..24a9f7e6f38 100644 --- a/.github/workflows/check_pr_for_broken_links.yml +++ b/.github/workflows/check_pr_for_broken_links.yml @@ -35,4 +35,4 @@ jobs: return await checkDevLinks(); - name: Fail if broken links have been found if: ${{ steps.checkLinks.outputs.result }} - run: exit 1 && echo ${{ toJson(steps.checkLinks.outputs.result) }} + run: exit 1