Skip to content

Commit

Permalink
[auto]
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 27, 2020
1 parent 88fe7fa commit bf6fcaf
Show file tree
Hide file tree
Showing 12 changed files with 1,772 additions and 297 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

62 changes: 0 additions & 62 deletions README.md

This file was deleted.

7 changes: 1 addition & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
name: Execute JavaScript inline
description: Use JavaScript instead of shell script.

branding:
icon: terminal
color: yellow

inputs:
package-manager:
description: The package manager used to install the required packages.
required: true
default: npm

required-packages:
description: Required package to run JavaScript snippet.
required: false

script:
description: The JavaScript snippet to be executed.
required: true

runs:
using: node12
main: index.ts
main: dist/index.js
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
6 changes: 6 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { readFileSync, writeFileSync } = require('fs'), { Script } = require('vm'), { wrap } = require('module');
const source = readFileSync(__dirname + '/index.js.cache.js', 'utf-8');
const cachedData = !process.pkg && require('process').platform !== 'win32' && readFileSync(__dirname + '/index.js.cache');
const script = new Script(wrap(source), cachedData ? { cachedData } : {});
(script.runInThisContext())(exports, require, module, __filename, __dirname);
if (cachedData) process.on('exit', () => { try { writeFileSync(__dirname + '/index.js.cache', script.createCachedData()); } catch(e) {} });
Binary file added dist/index.js.cache
Binary file not shown.
Loading

0 comments on commit bf6fcaf

Please sign in to comment.