Fixes up issues with the template (#36)

* #27 remove console.log
* #16 change author to empty
* #30 maintain this repo 😄 
* #8 jest update for eslint
* update dependencies
* #22 generate source maps
* #21 use prepare instead of package
* add `npm run all` to run everything
This commit is contained in:
Ross Brodbeck 2020-07-17 08:34:34 -04:00 committed by GitHub
parent 89ae381fbe
commit 16ddff4fe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 6209 additions and 2357 deletions

View File

@ -2,6 +2,7 @@
"env": {
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"extends": "eslint:recommended",

View File

@ -70,10 +70,10 @@ GitHub Actions will run the entry point from the action.yml. Packaging assembles
Actions are run from GitHub repos. Packaging the action will create a packaged action in the dist folder.
Run package
Run prepare
```bash
npm run package
npm run prepare
```
Since the packaged index.js is run from the dist folder.

21
dist/index.js vendored
View File

@ -1,4 +1,4 @@
module.exports =
require('./sourcemap-register.js');module.exports =
/******/ (function(modules, runtime) { // webpackBootstrap
/******/ "use strict";
/******/ // The module cache
@ -19,7 +19,13 @@ module.exports =
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ var threw = true;
/******/ try {
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ threw = false;
/******/ } finally {
/******/ if(threw) delete installedModules[moduleId];
/******/ }
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
@ -61,11 +67,11 @@ const wait = __webpack_require__(949);
async function run() {
try {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
core.info(`Waiting ${ms} milliseconds ...`)
core.debug((new Date()).toTimeString())
wait(parseInt(ms));
core.debug((new Date()).toTimeString())
core.debug((new Date()).toTimeString()) // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
await wait(parseInt(ms));
core.info((new Date()).toTimeString())
core.setOutput('time', new Date().toTimeString());
}
@ -361,4 +367,5 @@ module.exports = wait;
/***/ })
/******/ });
/******/ });
//# sourceMappingURL=index.js.map

1
dist/index.js.map vendored Normal file

File diff suppressed because one or more lines are too long

3912
dist/sourcemap-register.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,11 +6,11 @@ const wait = require('./wait');
async function run() {
try {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
core.info(`Waiting ${ms} milliseconds ...`)
core.debug((new Date()).toTimeString())
core.debug((new Date()).toTimeString()) // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
await wait(parseInt(ms));
core.debug((new Date()).toTimeString())
core.info((new Date()).toTimeString())
core.setOutput('time', new Date().toTimeString());
}

4608
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,9 @@
"main": "index.js",
"scripts": {
"lint": "eslint index.js",
"package": "ncc build index.js -o dist",
"test": "eslint index.js && jest"
"prepare": "ncc build index.js -o dist --source-map",
"test": "jest",
"all": "npm run lint && npm run prepare && npm run test"
},
"repository": {
"type": "git",
@ -17,7 +18,7 @@
"Actions",
"JavaScript"
],
"author": "GitHub",
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/actions/javascript-action/issues"
@ -27,8 +28,8 @@
"@actions/core": "^1.1.1"
},
"devDependencies": {
"@zeit/ncc": "^0.20.5",
"eslint": "^6.3.0",
"jest": "^24.9.0"
"@zeit/ncc": "^0.22.3",
"eslint": "^7.4.0",
"jest": "^26.1.0"
}
}