-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[All] Javascript-based github actions
- Loading branch information
Showing
8 changed files
with
64 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const system = require('../../system/module'); | ||
const core = system.core | ||
|
||
const path = require('node:path'); | ||
const app = core.getInput('docker_dir') | ||
|
||
system.run({ | ||
'dir': core.getInput('dir'), | ||
'docker_dir': path.join('/srv/app', app), | ||
'docker_env': 'XDG_CACHE_HOME=' + path.join('/srv/cache', app ? app : 'project'), | ||
'run': core.getInput('run'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
package-lock.json |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const core = require('@actions/core'); | ||
const exec = require('@actions/exec'); | ||
const os = require('node:os'); | ||
|
||
exports.core = core | ||
|
||
exports.run = async ({ dir, docker_dir, docker_env, run } = {}) => { | ||
process.stdout.write('[command]' + run.split(os.EOL, 1)[0] + os.EOL) | ||
// See: https://github.com/actions/toolkit/issues/649 | ||
const { stdout } = await exec.getExecOutput('make', ['sh'], { | ||
'cwd': dir, | ||
'input': Buffer.from(run, 'utf-8'), | ||
'env': { | ||
// See: https://github.com/actions/toolkit/issues/1158 | ||
...process.env, | ||
'MANALA_DOCKER_COMMAND_DIR': docker_dir, | ||
'MANALA_DOCKER_COMMAND_ENV': docker_env, | ||
}, | ||
'silent': true, | ||
}); | ||
process.stdout.write(stdout) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "ncc build index.js --minify --out dist", | ||
"watch": "ncc build index.js --minify --out dist --watch" | ||
}, | ||
"dependencies": { | ||
"@actions/core": "1.10.0", | ||
"@actions/exec": "1.1.1" | ||
}, | ||
"devDependencies": { | ||
"@vercel/ncc": "0.36.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const system = require('../module'); | ||
const core = system.core | ||
|
||
system.run({ | ||
'dir': core.getInput('dir'), | ||
'docker_dir': core.getInput('docker_dir'), | ||
'docker_env': core.getInput('docker_env'), | ||
'run': core.getInput('run'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters