From 9cde5462d50b0a66fdc78ea219aff63d5a749dc0 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:04:17 -0600 Subject: [PATCH 1/9] Add IS_PRODUCTION_DEPLOY flag and logic --- .../getReleasePullRequestList/action.yml | 5 ++- .../getReleasePullRequestList.js | 36 +++++++++++++------ .../getReleasePullRequestList/index.js | 36 +++++++++++++------ .github/workflows/platformDeploy.yml | 1 + 4 files changed, 57 insertions(+), 21 deletions(-) diff --git a/.github/actions/getReleasePullRequestList/action.yml b/.github/actions/getReleasePullRequestList/action.yml index b1c436e3a460..98dce92c2bcc 100644 --- a/.github/actions/getReleasePullRequestList/action.yml +++ b/.github/actions/getReleasePullRequestList/action.yml @@ -7,9 +7,12 @@ inputs: GITHUB_TOKEN: description: "Github token for authentication" required: true + IS_PRODUCTION_DEPLOY: + description: "True if we are deploying to production" + required: false outputs: PR_LIST: - description: Array of released pull request numbers + description: Array of pull request numbers runs: using: 'node12' main: './index.js' diff --git a/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js b/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js index 9c3169dee14e..f9d1b86e83a7 100644 --- a/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js +++ b/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js @@ -6,31 +6,47 @@ const GitUtils = require('../../libs/GitUtils'); const octokit = github.getOctokit(core.getInput('GITHUB_TOKEN', {required: true})); const inputTag = core.getInput('TAG', {required: true}); -console.log('Fetching release list from github...'); -octokit.repos.listReleases({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, -}) +const isProductionDeploy = JSON.parse(core.getInput('IS_PRODUCTION_DEPLOY', {required: false})); +const itemToFetch = isProductionDeploy ? 'release' : 'tag'; + +function getTagsOrReleases(fetchReleases) { + if (fetchReleases) { + return octokit.repos.listReleases({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + }); + } + + return octokit.repos.listTags({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + }); +} + +console.log(`Fetching ${itemToFetch} list from github...`); +getTagsOrReleases(isProductionDeploy) .catch(githubError => core.setFailed(githubError)) .then(({data}) => { - const tags = _.pluck(data, 'tag_name'); + const keyToPluck = isProductionDeploy ? 'tag_name' : 'name'; + const tags = _.pluck(data, keyToPluck); const priorTagIndex = _.indexOf(tags, inputTag) + 1; if (priorTagIndex === 0) { - console.log(`No release was found for input tag ${inputTag}. Comparing it to latest release ${tags[0]}`); + console.log(`No ${itemToFetch} was found for input tag ${inputTag}. + Comparing it to latest ${itemToFetch} ${tags[0]}`); } if (priorTagIndex === tags.length) { const err = new Error('Somehow, the input tag was at the end of the paginated result, ' - + "so we don't have the prior tag."); + + "so we don't have the prior tag."); console.error(err.message); core.setFailed(err); return; } const priorTag = tags[priorTagIndex]; - console.log(`Given Release Tag: ${inputTag}`); - console.log(`Prior Release Tag: ${priorTag}`); + console.log(`Given ${itemToFetch}: ${inputTag}`); + console.log(`Prior ${itemToFetch}: ${priorTag}`); return GitUtils.getPullRequestsMergedBetween(priorTag, inputTag); }) diff --git a/.github/actions/getReleasePullRequestList/index.js b/.github/actions/getReleasePullRequestList/index.js index cf1a30f951e5..96b742ef63d1 100644 --- a/.github/actions/getReleasePullRequestList/index.js +++ b/.github/actions/getReleasePullRequestList/index.js @@ -16,31 +16,47 @@ const GitUtils = __nccwpck_require__(669); const octokit = github.getOctokit(core.getInput('GITHUB_TOKEN', {required: true})); const inputTag = core.getInput('TAG', {required: true}); -console.log('Fetching release list from github...'); -octokit.repos.listReleases({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, -}) +const isProductionDeploy = JSON.parse(core.getInput('IS_PRODUCTION_DEPLOY', {required: false})); +const itemToFetch = isProductionDeploy ? 'release' : 'tag'; + +function getTagsOrReleases(fetchReleases) { + if (fetchReleases) { + return octokit.repos.listReleases({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + }); + } + + return octokit.repos.listTags({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + }); +} + +console.log(`Fetching ${itemToFetch} list from github...`); +getTagsOrReleases(isProductionDeploy) .catch(githubError => core.setFailed(githubError)) .then(({data}) => { - const tags = _.pluck(data, 'tag_name'); + const keyToPluck = isProductionDeploy ? 'tag_name' : 'name'; + const tags = _.pluck(data, keyToPluck); const priorTagIndex = _.indexOf(tags, inputTag) + 1; if (priorTagIndex === 0) { - console.log(`No release was found for input tag ${inputTag}. Comparing it to latest release ${tags[0]}`); + console.log(`No ${itemToFetch} was found for input tag ${inputTag}. + Comparing it to latest ${itemToFetch} ${tags[0]}`); } if (priorTagIndex === tags.length) { const err = new Error('Somehow, the input tag was at the end of the paginated result, ' - + "so we don't have the prior tag."); + + "so we don't have the prior tag."); console.error(err.message); core.setFailed(err); return; } const priorTag = tags[priorTagIndex]; - console.log(`Given Release Tag: ${inputTag}`); - console.log(`Prior Release Tag: ${priorTag}`); + console.log(`Given ${itemToFetch}: ${inputTag}`); + console.log(`Prior ${itemToFetch}: ${priorTag}`); return GitUtils.getPullRequestsMergedBetween(priorTag, inputTag); }) diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index ae3eff18b447..58bdb5ce2876 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -285,6 +285,7 @@ jobs: with: TAG: ${{ env.VERSION }} GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} + IS_PRODUCTION_DEPLOY: ${{ env.SHOULD_DEPLOY_PRODUCTION == 'true' }} - name: Comment on issues uses: Expensify/Expensify.cash/.github/actions/markPullRequestsAsDeployed@main From 5ccd852681d202ee4d7685f412b41462670984b5 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:04:37 -0600 Subject: [PATCH 2/9] Clean up comment for deploy --- .github/actions/markPullRequestsAsDeployed/index.js | 10 +++------- .../markPullRequestsAsDeployed.js | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index eaffa177a2f4..eb24d24e90c5 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -17,8 +17,6 @@ const isProd = JSON.parse( core.getInput('IS_PRODUCTION_DEPLOY', {required: true}), ); const token = core.getInput('GITHUB_TOKEN', {required: true}); -const date = new Date(); - const octokit = github.getOctokit(token); const githubUtils = new GithubUtils(octokit); @@ -47,12 +45,10 @@ const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', {required: const iOSResult = getDeployTableMessage(core.getInput('IOS', {required: true})); const webResult = getDeployTableMessage(core.getInput('WEB', {required: true})); -const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY} - /actions/runs/${process.env.GITHUB_RUN_ID}`; - -let message = `šŸš€ [Deployed](${workflowURL}) šŸš€ to - ${isProd ? 'production' : 'staging'} on ${date.toDateString()} at ${date.toTimeString()}`; +const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}` + + `/actions/runs/${process.env.GITHUB_RUN_ID}`; +let message = `šŸš€ [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} šŸš€`; message += `\n\n platform | result \n ---|--- \nšŸ¤– android šŸ¤–|${androidResult} \nšŸ–„ desktop šŸ–„|${desktopResult}`; message += `\nšŸŽ iOS šŸŽ|${iOSResult} \nšŸ•ø web šŸ•ø|${webResult}`; diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 59cbbdbdb13f..3449a4341088 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -7,8 +7,6 @@ const isProd = JSON.parse( core.getInput('IS_PRODUCTION_DEPLOY', {required: true}), ); const token = core.getInput('GITHUB_TOKEN', {required: true}); -const date = new Date(); - const octokit = github.getOctokit(token); const githubUtils = new GithubUtils(octokit); @@ -37,12 +35,10 @@ const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', {required: const iOSResult = getDeployTableMessage(core.getInput('IOS', {required: true})); const webResult = getDeployTableMessage(core.getInput('WEB', {required: true})); -const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY} - /actions/runs/${process.env.GITHUB_RUN_ID}`; - -let message = `šŸš€ [Deployed](${workflowURL}) šŸš€ to - ${isProd ? 'production' : 'staging'} on ${date.toDateString()} at ${date.toTimeString()}`; +const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}` + + `/actions/runs/${process.env.GITHUB_RUN_ID}`; +let message = `šŸš€ [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} šŸš€`; message += `\n\n platform | result \n ---|--- \nšŸ¤– android šŸ¤–|${androidResult} \nšŸ–„ desktop šŸ–„|${desktopResult}`; message += `\nšŸŽ iOS šŸŽ|${iOSResult} \nšŸ•ø web šŸ•ø|${webResult}`; From 334528f4f0175e598704c314a3efb8a6c9a7fc20 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:23:09 -0600 Subject: [PATCH 3/9] Add JSDoc --- .../getReleasePullRequestList/getReleasePullRequestList.js | 6 ++++++ .github/actions/getReleasePullRequestList/index.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js b/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js index f9d1b86e83a7..9f4e90cd7faf 100644 --- a/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js +++ b/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js @@ -9,6 +9,12 @@ const inputTag = core.getInput('TAG', {required: true}); const isProductionDeploy = JSON.parse(core.getInput('IS_PRODUCTION_DEPLOY', {required: false})); const itemToFetch = isProductionDeploy ? 'release' : 'tag'; +/** + * Gets either releases or tags for a GitHub repo + * + * @param {boolean} fetchReleases + * @returns {*} + */ function getTagsOrReleases(fetchReleases) { if (fetchReleases) { return octokit.repos.listReleases({ diff --git a/.github/actions/getReleasePullRequestList/index.js b/.github/actions/getReleasePullRequestList/index.js index 96b742ef63d1..5e944b09bb68 100644 --- a/.github/actions/getReleasePullRequestList/index.js +++ b/.github/actions/getReleasePullRequestList/index.js @@ -19,6 +19,12 @@ const inputTag = core.getInput('TAG', {required: true}); const isProductionDeploy = JSON.parse(core.getInput('IS_PRODUCTION_DEPLOY', {required: false})); const itemToFetch = isProductionDeploy ? 'release' : 'tag'; +/** + * Gets either releases or tags for a GitHub repo + * + * @param {boolean} fetchReleases + * @returns {*} + */ function getTagsOrReleases(fetchReleases) { if (fetchReleases) { return octokit.repos.listReleases({ From ed26cf366f54b2df9cf118059b0c180d689a3784 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:26:44 -0600 Subject: [PATCH 4/9] Update regex for finding PRs between two tags --- .github/actions/createOrUpdateStagingDeploy/index.js | 2 +- .github/actions/getReleasePullRequestList/index.js | 2 +- .github/libs/GitUtils.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/createOrUpdateStagingDeploy/index.js b/.github/actions/createOrUpdateStagingDeploy/index.js index 00be81386a33..5fc7ffa6c9bc 100644 --- a/.github/actions/createOrUpdateStagingDeploy/index.js +++ b/.github/actions/createOrUpdateStagingDeploy/index.js @@ -99,7 +99,7 @@ const exec = promisify(__nccwpck_require__(3129).exec); function getPullRequestsMergedBetween(fromRef, toRef) { return exec(`git log --format="%s" ${fromRef}...${toRef}`) .then(({stdout}) => ( - [...stdout.matchAll(/Merge pull request #(\d{1,6})/g)] + [...stdout.matchAll(/Merge pull request #(\d{1,6}) from (?!Expensify\/(?:master|main|version-))/g)] .map(match => match[1]) )); } diff --git a/.github/actions/getReleasePullRequestList/index.js b/.github/actions/getReleasePullRequestList/index.js index 5e944b09bb68..4ea74da4656b 100644 --- a/.github/actions/getReleasePullRequestList/index.js +++ b/.github/actions/getReleasePullRequestList/index.js @@ -88,7 +88,7 @@ const exec = promisify(__nccwpck_require__(3129).exec); function getPullRequestsMergedBetween(fromRef, toRef) { return exec(`git log --format="%s" ${fromRef}...${toRef}`) .then(({stdout}) => ( - [...stdout.matchAll(/Merge pull request #(\d{1,6})/g)] + [...stdout.matchAll(/Merge pull request #(\d{1,6}) from (?!Expensify\/(?:master|main|version-))/g)] .map(match => match[1]) )); } diff --git a/.github/libs/GitUtils.js b/.github/libs/GitUtils.js index d1af2ab3440a..6c7110c07074 100644 --- a/.github/libs/GitUtils.js +++ b/.github/libs/GitUtils.js @@ -11,7 +11,7 @@ const exec = promisify(require('child_process').exec); function getPullRequestsMergedBetween(fromRef, toRef) { return exec(`git log --format="%s" ${fromRef}...${toRef}`) .then(({stdout}) => ( - [...stdout.matchAll(/Merge pull request #(\d{1,6})/g)] + [...stdout.matchAll(/Merge pull request #(\d{1,6}) from (?!Expensify\/(?:master|main|version-))/g)] .map(match => match[1]) )); } From faa4a10e0caceeafd32a274e10c60069376234a7 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:29:35 -0600 Subject: [PATCH 5/9] Rename getReleasePullRequestList -> getDeployPullRequestList --- .../action.yml | 0 .../getDeployPullRequestList.js} | 0 .../index.js | 4 ++-- .github/scripts/buildActions.sh | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/platformDeploy.yml | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename .github/actions/{getReleasePullRequestList => getDeployPullRequestList}/action.yml (100%) rename .github/actions/{getReleasePullRequestList/getReleasePullRequestList.js => getDeployPullRequestList/getDeployPullRequestList.js} (100%) rename .github/actions/{getReleasePullRequestList => getDeployPullRequestList}/index.js (99%) diff --git a/.github/actions/getReleasePullRequestList/action.yml b/.github/actions/getDeployPullRequestList/action.yml similarity index 100% rename from .github/actions/getReleasePullRequestList/action.yml rename to .github/actions/getDeployPullRequestList/action.yml diff --git a/.github/actions/getReleasePullRequestList/getReleasePullRequestList.js b/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js similarity index 100% rename from .github/actions/getReleasePullRequestList/getReleasePullRequestList.js rename to .github/actions/getDeployPullRequestList/getDeployPullRequestList.js diff --git a/.github/actions/getReleasePullRequestList/index.js b/.github/actions/getDeployPullRequestList/index.js similarity index 99% rename from .github/actions/getReleasePullRequestList/index.js rename to .github/actions/getDeployPullRequestList/index.js index 4ea74da4656b..8d5ca7f7e8ce 100644 --- a/.github/actions/getReleasePullRequestList/index.js +++ b/.github/actions/getDeployPullRequestList/index.js @@ -5,7 +5,7 @@ module.exports = /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 4365: +/***/ 6062: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { const _ = __nccwpck_require__(4987); @@ -11246,6 +11246,6 @@ module.exports = require("zlib");; /******/ // module exports must be returned from runtime so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports -/******/ return __nccwpck_require__(4365); +/******/ return __nccwpck_require__(6062); /******/ })() ; diff --git a/.github/scripts/buildActions.sh b/.github/scripts/buildActions.sh index bf43372e5da0..af9811f7e328 100755 --- a/.github/scripts/buildActions.sh +++ b/.github/scripts/buildActions.sh @@ -13,7 +13,7 @@ declare -r GITHUB_ACTIONS=( "$ACTIONS_DIR/checkDeployBlockers/checkDeployBlockers.js" "$ACTIONS_DIR/createOrUpdateStagingDeploy/createOrUpdateStagingDeploy.js" "$ACTIONS_DIR/getReleaseBody/getReleaseBody.js" - "$ACTIONS_DIR/getReleasePullRequestList/getReleasePullRequestList.js" + "$ACTIONS_DIR/getDeployPullRequestList/getDeployPullRequestList.js" "$ACTIONS_DIR/isPullRequestMergeable/isPullRequestMergeable.js" "$ACTIONS_DIR/isStagingDeployLocked/isStagingDeployLocked.js" "$ACTIONS_DIR/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 10b7b424ff69..30108d10511c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,7 +40,7 @@ jobs: - name: Get Release Pull Request List id: getReleasePRList - uses: Expensify/Expensify.cash/.github/actions/getReleasePullRequestList@main + uses: Expensify/Expensify.cash/.github/actions/getDeployPullRequestList@main with: TAG: ${{ env.PRODUCTION_VERSION }} GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 58bdb5ce2876..0255fc0302a2 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -281,7 +281,7 @@ jobs: - name: Get Release Pull Request List id: getReleasePRList - uses: Expensify/Expensify.cash/.github/actions/getReleasePullRequestList@main + uses: Expensify/Expensify.cash/.github/actions/getDeployPullRequestList@main with: TAG: ${{ env.VERSION }} GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} From 32efcb3bdb6c5fd5d5d38908062b29cc3542e6f3 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:39:54 -0600 Subject: [PATCH 6/9] Fix unit tests --- tests/unit/GitUtilsTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/GitUtilsTest.js b/tests/unit/GitUtilsTest.js index ba579585f5a3..d84b724a169c 100644 --- a/tests/unit/GitUtilsTest.js +++ b/tests/unit/GitUtilsTest.js @@ -36,7 +36,7 @@ const data = [ Merge pull request #1555 from SameeraMadushan/sameera-IsAppInstalledLogic fix: set pdf width on large screens [IS-1500] Fixed compose field alignment issue`, - result: ['1521', '1563', '1557', '1562', '1515', '1560', '1555'], + result: ['1521', '1557', '1515', '1555'], }, { gitLog: `Return to old hash-based deploy instrcutions From 9a7b74a425320a719ad3c6f00a180e2507fd0f65 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:47:20 -0600 Subject: [PATCH 7/9] Update test data --- tests/unit/GitUtilsTest.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/GitUtilsTest.js b/tests/unit/GitUtilsTest.js index d84b724a169c..77845a4c31c3 100644 --- a/tests/unit/GitUtilsTest.js +++ b/tests/unit/GitUtilsTest.js @@ -34,6 +34,8 @@ const data = [ Merge pull request #1560 from Expensify/version-bump-b742a55d18e761cd7adb0849a29cfb48b3a04f99 Update version to 1.0.1-468 Merge pull request #1555 from SameeraMadushan/sameera-IsAppInstalledLogic + Merge pull request #1 from Expensify/master + Merge pull request #2 from Expensify/main fix: set pdf width on large screens [IS-1500] Fixed compose field alignment issue`, result: ['1521', '1557', '1515', '1555'], From 67fbe6d71d93f44910cc1231d31a7377f395fcaf Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 17:50:48 -0600 Subject: [PATCH 8/9] Address peer review comments --- .../getDeployPullRequestList/getDeployPullRequestList.js | 5 ++++- .github/actions/getDeployPullRequestList/index.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js b/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js index 9f4e90cd7faf..e0cc13485a6b 100644 --- a/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js +++ b/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js @@ -56,5 +56,8 @@ getTagsOrReleases(isProductionDeploy) return GitUtils.getPullRequestsMergedBetween(priorTag, inputTag); }) - .then(pullRequestList => core.setOutput('PR_LIST', pullRequestList)) + .then((pullRequestList) => { + console.log(`Found the pull request list: ${pullRequestList}`); + return core.setOutput('PR_LIST', pullRequestList); + }) .catch(error => core.setFailed(error)); diff --git a/.github/actions/getDeployPullRequestList/index.js b/.github/actions/getDeployPullRequestList/index.js index 8d5ca7f7e8ce..eb1d432f208c 100644 --- a/.github/actions/getDeployPullRequestList/index.js +++ b/.github/actions/getDeployPullRequestList/index.js @@ -66,7 +66,10 @@ getTagsOrReleases(isProductionDeploy) return GitUtils.getPullRequestsMergedBetween(priorTag, inputTag); }) - .then(pullRequestList => core.setOutput('PR_LIST', pullRequestList)) + .then((pullRequestList) => { + console.log(`Found the pull request list: ${pullRequestList}`); + return core.setOutput('PR_LIST', pullRequestList); + }) .catch(error => core.setFailed(error)); From 4cb63fae12884712006da975425c6ae7fe2498b8 Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 19 Apr 2021 18:01:54 -0600 Subject: [PATCH 9/9] Fix spacing in console logs --- .../getDeployPullRequestList/getDeployPullRequestList.js | 6 +++--- .github/actions/getDeployPullRequestList/index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js b/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js index e0cc13485a6b..41f1250d9b04 100644 --- a/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js +++ b/.github/actions/getDeployPullRequestList/getDeployPullRequestList.js @@ -38,13 +38,13 @@ getTagsOrReleases(isProductionDeploy) const priorTagIndex = _.indexOf(tags, inputTag) + 1; if (priorTagIndex === 0) { - console.log(`No ${itemToFetch} was found for input tag ${inputTag}. - Comparing it to latest ${itemToFetch} ${tags[0]}`); + console.log(`No ${itemToFetch} was found for input tag ${inputTag}.` + + `Comparing it to latest ${itemToFetch} ${tags[0]}`); } if (priorTagIndex === tags.length) { const err = new Error('Somehow, the input tag was at the end of the paginated result, ' - + "so we don't have the prior tag."); + + 'so we don\'t have the prior tag'); console.error(err.message); core.setFailed(err); return; diff --git a/.github/actions/getDeployPullRequestList/index.js b/.github/actions/getDeployPullRequestList/index.js index eb1d432f208c..6072f2ff469d 100644 --- a/.github/actions/getDeployPullRequestList/index.js +++ b/.github/actions/getDeployPullRequestList/index.js @@ -48,13 +48,13 @@ getTagsOrReleases(isProductionDeploy) const priorTagIndex = _.indexOf(tags, inputTag) + 1; if (priorTagIndex === 0) { - console.log(`No ${itemToFetch} was found for input tag ${inputTag}. - Comparing it to latest ${itemToFetch} ${tags[0]}`); + console.log(`No ${itemToFetch} was found for input tag ${inputTag}.` + + `Comparing it to latest ${itemToFetch} ${tags[0]}`); } if (priorTagIndex === tags.length) { const err = new Error('Somehow, the input tag was at the end of the paginated result, ' - + "so we don't have the prior tag."); + + 'so we don\'t have the prior tag'); console.error(err.message); core.setFailed(err); return;