From eee01a5a35f597c29b768631f50be0662c6732e1 Mon Sep 17 00:00:00 2001 From: Stephen Brandwood <614392+sbrandwoo@users.noreply.github.com> Date: Tue, 29 Jun 2021 11:27:36 +0100 Subject: [PATCH] Rename default-branch option to base-branch --- README.md | 2 +- dist/index.js | 8 ++++---- src/index.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index faffcbb..61ffc10 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Add the following step to a workflow, after the Next.js project has been built ( uses: transferwise/actions-next-bundle-analyzer@master with: # Optional, defaults to master - default-branch: master + base-branch: master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` diff --git a/dist/index.js b/dist/index.js index 0136e1e..aa53632 100644 --- a/dist/index.js +++ b/dist/index.js @@ -15577,16 +15577,16 @@ var FILE_NAME = 'bundle-sizes.json'; function run() { var _a; return src_awaiter(this, void 0, void 0, function () { - var defaultBranch, octokit, issueNumber, masterBundleSizes, bundleSizes, prefix, markdownTable, body, e_1; + var baseBranch, octokit, issueNumber, masterBundleSizes, bundleSizes, prefix, markdownTable, body, e_1; return src_generator(this, function (_b) { switch (_b.label) { case 0: _b.trys.push([0, 3, , 4]); - defaultBranch = core.getInput('default-branch') || 'master'; + baseBranch = core.getInput('base-branch') || 'master'; octokit = github.getOctokit(process.env.GITHUB_TOKEN || ''); issueNumber = (_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number; - console.log("> Downloading bundle sizes from " + defaultBranch); - return [4 /*yield*/, downloadArtifactAsJson(octokit, defaultBranch, github.context.workflow, ARTIFACT_NAME, FILE_NAME)]; + console.log("> Downloading bundle sizes from " + baseBranch); + return [4 /*yield*/, downloadArtifactAsJson(octokit, baseBranch, github.context.workflow, ARTIFACT_NAME, FILE_NAME)]; case 1: masterBundleSizes = (_b.sent()) || []; console.log(masterBundleSizes); diff --git a/src/index.ts b/src/index.ts index 80b7eb8..966cd89 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,16 +15,16 @@ const FILE_NAME = 'bundle-sizes.json'; async function run() { try { - const defaultBranch = core.getInput('default-branch') || 'master'; + const baseBranch = core.getInput('base-branch') || 'master'; const octokit = github.getOctokit(process.env.GITHUB_TOKEN || ''); const issueNumber = github.context.payload.pull_request?.number; - console.log(`> Downloading bundle sizes from ${defaultBranch}`); + console.log(`> Downloading bundle sizes from ${baseBranch}`); const masterBundleSizes: PageBundleSizes = (await downloadArtifactAsJson( octokit, - defaultBranch, + baseBranch, github.context.workflow, ARTIFACT_NAME, FILE_NAME