From 5326145965b10b4177a8b1987385d1eca06c6f7a Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 14 Nov 2019 17:40:20 +0900 Subject: [PATCH] v1.1.0 --- .gitignore | 1 + action.yml | 5 +- config.js | 15 +- default_index_html.js | 4 +- extract.js | 9 +- foo.js | 67 - git.js | 47 +- index.js | 2 +- node_modules/@actions/core/package.json | 24 +- node_modules/@actions/exec/package.json | 24 +- node_modules/@actions/github/package.json | 24 +- node_modules/@actions/io/package.json | 24 +- .../universal-user-agent/package.json | 23 +- node_modules/@octokit/endpoint/package.json | 23 +- node_modules/@octokit/graphql/package.json | 23 +- .../@octokit/request-error/package.json | 23 +- .../universal-user-agent/package.json | 23 +- node_modules/@octokit/request/package.json | 23 +- .../universal-user-agent/package.json | 23 +- node_modules/@octokit/rest/package.json | 23 +- node_modules/@octokit/types/package.json | 23 +- node_modules/@types/node/README.md | 2 +- node_modules/@types/node/constants.d.ts | 134 + node_modules/@types/node/os.d.ts | 58 + node_modules/@types/node/package.json | 36 +- node_modules/@types/node/stream.d.ts | 7 +- node_modules/atob-lite/package.json | 23 +- node_modules/before-after-hook/package.json | 23 +- node_modules/btoa-lite/package.json | 23 +- node_modules/cross-spawn/package.json | 23 +- node_modules/deprecation/package.json | 23 +- node_modules/end-of-stream/package.json | 23 +- node_modules/execa/package.json | 23 +- node_modules/get-stream/package.json | 23 +- node_modules/is-plain-object/package.json | 23 +- node_modules/is-stream/package.json | 23 +- node_modules/isexe/package.json | 23 +- node_modules/isobject/package.json | 23 +- node_modules/lodash.get/package.json | 23 +- node_modules/lodash.set/package.json | 23 +- node_modules/lodash.uniq/package.json | 23 +- node_modules/macos-release/package.json | 23 +- node_modules/nice-try/package.json | 23 +- node_modules/node-fetch/package.json | 23 +- node_modules/npm-run-path/package.json | 23 +- .../octokit-pagination-methods/package.json | 23 +- node_modules/once/package.json | 23 +- node_modules/os-name/package.json | 23 +- node_modules/p-finally/package.json | 23 +- node_modules/path-key/package.json | 23 +- node_modules/pump/package.json | 23 +- node_modules/semver/package.json | 23 +- node_modules/shebang-command/package.json | 23 +- node_modules/shebang-regex/package.json | 23 +- node_modules/signal-exit/package.json | 23 +- node_modules/strip-eof/package.json | 23 +- .../universal-user-agent/package.json | 23 +- node_modules/which/package.json | 23 +- node_modules/windows-release/package.json | 23 +- node_modules/wrappy/package.json | 23 +- package-lock.json | 2638 ++++++++++++++++- package.json | 28 +- write.js | 39 +- 63 files changed, 3290 insertions(+), 887 deletions(-) delete mode 100644 foo.js diff --git a/.gitignore b/.gitignore index fd4437e9e..1d7717561 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /*.js.map /examples +/test diff --git a/action.yml b/action.yml index 558b7be2c..02e08c231 100644 --- a/action.yml +++ b/action.yml @@ -18,9 +18,12 @@ inputs: required: true default: 'gh-pages' benchmark-data-dir-path: - description: 'Path to directory which contains JSON files benchmarks' + description: 'Path to directory which contains benchmark files on GitHub pages branch' required: true default: 'dev/bench' + github-token: + description: 'GitHub API token to pull/push GitHub pages branch and deploy GitHub pages' + required: false runs: using: 'node12' diff --git a/config.js b/config.js index 779e8cf87..5a829f075 100644 --- a/config.js +++ b/config.js @@ -69,18 +69,29 @@ function validateName(name) { } throw new Error('Name must not be empty'); } +function validateAutoPush(autoPush, githubToken) { + if (!autoPush) { + return; + } + if (!githubToken) { + throw new Error("'auto-push' is enabled but 'github-token' is not set. Please give API token for pushing GitHub pages branch to remote"); + } +} async function configFromJobInput() { const tool = core.getInput('tool'); let outputFilePath = core.getInput('output-file-path'); const ghPagesBranch = core.getInput('gh-pages-branch'); let benchmarkDataDirPath = core.getInput('benchmark-data-dir-path'); const name = core.getInput('name'); + const githubToken = core.getInput('github-token') || undefined; + const autoPush = core.getInput('auto-push') === 'true'; validateToolType(tool); outputFilePath = await validateOutputFilePath(outputFilePath); validateGhPagesBranch(ghPagesBranch); benchmarkDataDirPath = validateBenchmarkDataDirPath(benchmarkDataDirPath); validateName(name); - return { name, tool, outputFilePath, ghPagesBranch, benchmarkDataDirPath }; + validateAutoPush(autoPush, githubToken); + return { name, tool, outputFilePath, ghPagesBranch, benchmarkDataDirPath, githubToken, autoPush }; } exports.configFromJobInput = configFromJobInput; -//# sourceMappingURL=config.js.map \ No newline at end of file +//# sourceMappingURL=config.js.map diff --git a/default_index_html.js b/default_index_html.js index c4c474783..da25d6818 100644 --- a/default_index_html.js +++ b/default_index_html.js @@ -89,7 +89,7 @@ exports.DEFAULT_INDEX_HTML = String.raw ` -