mirror of
https://github.com/Borales/actions-yarn.git
synced 2026-06-25 18:09:27 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16098ef84e | |||
| 9e77a0618b | |||
| 17af3bf048 |
@@ -1,5 +1,9 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 4.1.0 (26 Nov 2022)
|
||||||
|
|
||||||
|
- Added `dir` option
|
||||||
|
|
||||||
## 4.0.0 (26 Nov 2022)
|
## 4.0.0 (26 Nov 2022)
|
||||||
|
|
||||||
- Migrated to Actions toolkit
|
- Migrated to Actions toolkit
|
||||||
|
|||||||
@@ -37,8 +37,16 @@ jobs:
|
|||||||
uses: borales/actions-yarn@v4
|
uses: borales/actions-yarn@v4
|
||||||
with:
|
with:
|
||||||
cmd: test # will run `yarn test` command
|
cmd: test # will run `yarn test` command
|
||||||
|
|
||||||
|
- name: Run test in sub-folder
|
||||||
|
uses: borales/actions-yarn@v4
|
||||||
|
with:
|
||||||
|
cmd: test
|
||||||
|
dir: 'frontend' # will run `yarn test` in `frontend` sub folder
|
||||||
```
|
```
|
||||||
|
|
||||||
> `cmd` value will be used as a command for Yarn
|
> `cmd` value will be used as a command for Yarn
|
||||||
|
>
|
||||||
|
> `dir` value will be used for Yarn `cwd`
|
||||||
|
|
||||||
More information about [private registry setup](https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#use-private-packages).
|
More information about [private registry setup](https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#use-private-packages).
|
||||||
|
|||||||
+4
-7
@@ -8,13 +8,10 @@ inputs:
|
|||||||
cmd:
|
cmd:
|
||||||
description: 'Yarn command'
|
description: 'Yarn command'
|
||||||
required: true
|
required: true
|
||||||
# auth-token:
|
dir:
|
||||||
# description: 'NPM_AUTH_TOKEN'
|
description: 'Yarn sub-folder (if needed)'
|
||||||
# registry-url:
|
required: false
|
||||||
# description: 'NPM_REGISTRY_URL'
|
default: ''
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
# env:
|
|
||||||
# NPM_AUTH_TOKEN: ${{ inputs.auth-token }}
|
|
||||||
# NPM_REGISTRY_URL: ${{ inputs.registry-url }}
|
|
||||||
|
|||||||
Vendored
+3
-1
@@ -19,10 +19,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||||||
const core_1 = __nccwpck_require__(186);
|
const core_1 = __nccwpck_require__(186);
|
||||||
const yarn_1 = __nccwpck_require__(820);
|
const yarn_1 = __nccwpck_require__(820);
|
||||||
const run_1 = __nccwpck_require__(884);
|
const run_1 = __nccwpck_require__(884);
|
||||||
|
const path_1 = __nccwpck_require__(17);
|
||||||
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
yield (0, yarn_1.ensureYarnIsInstalled)();
|
yield (0, yarn_1.ensureYarnIsInstalled)();
|
||||||
const cmd = (0, core_1.getInput)('cmd', { required: true });
|
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 {
|
try {
|
||||||
(0, core_1.debug)(`Running "${cmd}" command`);
|
(0, core_1.debug)(`Running "${cmd}" command`);
|
||||||
yield (0, run_1.run)(cmd, { cwd });
|
yield (0, run_1.run)(cmd, { cwd });
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+3
-1
@@ -1,12 +1,14 @@
|
|||||||
import {debug, getInput, setFailed, getState} from '@actions/core'
|
import {debug, getInput, setFailed, getState} from '@actions/core'
|
||||||
import {ensureYarnIsInstalled} from './yarn'
|
import {ensureYarnIsInstalled} from './yarn'
|
||||||
import {run} from './run'
|
import {run} from './run'
|
||||||
|
import {resolve} from 'path'
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
await ensureYarnIsInstalled()
|
await ensureYarnIsInstalled()
|
||||||
|
|
||||||
const cmd: string = getInput('cmd', {required: true})
|
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 {
|
try {
|
||||||
debug(`Running "${cmd}" command`)
|
debug(`Running "${cmd}" command`)
|
||||||
|
|||||||
Reference in New Issue
Block a user