mirror of
https://github.com/Borales/actions-yarn.git
synced 2026-04-05 20:42:20 +08:00
commit
9e77a0618b
11
action.yml
11
action.yml
@ -8,13 +8,10 @@ inputs:
|
||||
cmd:
|
||||
description: 'Yarn command'
|
||||
required: true
|
||||
# auth-token:
|
||||
# description: 'NPM_AUTH_TOKEN'
|
||||
# registry-url:
|
||||
# description: 'NPM_REGISTRY_URL'
|
||||
dir:
|
||||
description: 'Yarn sub-folder (if needed)'
|
||||
required: false
|
||||
default: ''
|
||||
runs:
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
# env:
|
||||
# NPM_AUTH_TOKEN: ${{ inputs.auth-token }}
|
||||
# NPM_REGISTRY_URL: ${{ inputs.registry-url }}
|
||||
|
||||
4
dist/index.js
vendored
4
dist/index.js
vendored
@ -19,10 +19,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const core_1 = __nccwpck_require__(186);
|
||||
const yarn_1 = __nccwpck_require__(820);
|
||||
const run_1 = __nccwpck_require__(884);
|
||||
const path_1 = __nccwpck_require__(17);
|
||||
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
yield (0, yarn_1.ensureYarnIsInstalled)();
|
||||
const cmd = (0, core_1.getInput)('cmd', { required: true });
|
||||
const cwd = (0, core_1.getState)('repositoryPath');
|
||||
const dir = (0, core_1.getInput)('dir');
|
||||
const cwd = (0, path_1.resolve)((0, core_1.getState)('repositoryPath'), dir || '');
|
||||
try {
|
||||
(0, core_1.debug)(`Running "${cmd}" command`);
|
||||
yield (0, run_1.run)(cmd, { cwd });
|
||||
|
||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,12 +1,14 @@
|
||||
import {debug, getInput, setFailed, getState} from '@actions/core'
|
||||
import {ensureYarnIsInstalled} from './yarn'
|
||||
import {run} from './run'
|
||||
import {resolve} from 'path'
|
||||
|
||||
const main = async () => {
|
||||
await ensureYarnIsInstalled()
|
||||
|
||||
const cmd: string = getInput('cmd', {required: true})
|
||||
const cwd: string = getState('repositoryPath')
|
||||
const dir: string = getInput('dir')
|
||||
const cwd: string = resolve(getState('repositoryPath'), dir || '')
|
||||
|
||||
try {
|
||||
debug(`Running "${cmd}" command`)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user