Skip to content

Commit

Permalink
Rename default-branch option to base-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrandwoo committed Jun 29, 2021
1 parent cc089aa commit eee01a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
```
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eee01a5

Please sign in to comment.