mirror of
https://github.com/Borales/actions-yarn.git
synced 2026-06-21 23:59:26 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97ba8bebfe | |||
| d8b5ea8c26 | |||
| ac4aa8b421 | |||
| d0b398ccef | |||
| 32394b360b | |||
| b257940aaa | |||
| 062383b267 | |||
| d236877258 | |||
| 21a4e475d0 | |||
| 16098ef84e | |||
| 9e77a0618b | |||
| 17af3bf048 |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["config:base", "group:typescript-eslintMonorepo"],
|
||||
"labels": ["dependencies"],
|
||||
"rangeStrategy": "bump",
|
||||
"reviewers": ["borales"],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchSourceUrlPrefixes": ["https://github.com/actions/toolkit"],
|
||||
"groupName": "GitHub Actions Toolkit"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 4.2.0 (5 Dev 2022)
|
||||
|
||||
- Added proper support for multiple arguments
|
||||
|
||||
## 4.1.0 (26 Nov 2022)
|
||||
|
||||
- Added `dir` option
|
||||
|
||||
## 4.0.0 (26 Nov 2022)
|
||||
|
||||
- Migrated to Actions toolkit
|
||||
|
||||
@@ -6,11 +6,14 @@ This Action for [yarn](https://yarnpkg.com) enables arbitrary actions with the `
|
||||
|
||||
## Usage
|
||||
|
||||
> It is required to run `actions/setup-node@v3` before `borales/actions-yarn` in order to setup the desired node version.
|
||||
|
||||
An example workflow how to install packages via Yarn (using repository syntax):
|
||||
|
||||
```yml
|
||||
name: CI
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test
|
||||
@@ -37,8 +40,16 @@ jobs:
|
||||
uses: borales/actions-yarn@v4
|
||||
with:
|
||||
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
|
||||
>
|
||||
> `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).
|
||||
|
||||
+4
-7
@@ -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 }}
|
||||
|
||||
Vendored
+4
-2
@@ -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 });
|
||||
@@ -55,7 +57,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.run = void 0;
|
||||
const exec_1 = __nccwpck_require__(514);
|
||||
const run = (cmd, { cwd }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
yield (0, exec_1.exec)('yarn', [cmd], { cwd });
|
||||
yield (0, exec_1.exec)('yarn', cmd.split(' '), { cwd });
|
||||
});
|
||||
exports.run = run;
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
+8
-8
@@ -13,10 +13,10 @@
|
||||
"@actions/io": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/node": "^18.11.10",
|
||||
"@typescript-eslint/parser": "^5.44.0",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-plugin-github": "^4.4.1",
|
||||
"eslint-plugin-jest": "^27.1.6",
|
||||
"jest": "^29.3.1",
|
||||
@@ -1331,9 +1331,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "18.11.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz",
|
||||
"integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==",
|
||||
"version": "18.11.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.10.tgz",
|
||||
"integrity": "sha512-juG3RWMBOqcOuXC643OAdSA525V44cVgGV6dUDuiFtss+8Fk5x1hI93Rsld43VeJVIeqlP9I7Fn9/qaVqoEAuQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/prettier": {
|
||||
@@ -2329,9 +2329,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.28.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.28.0.tgz",
|
||||
"integrity": "sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==",
|
||||
"version": "8.29.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz",
|
||||
"integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint/eslintrc": "^1.3.3",
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@borales/actions-yarn",
|
||||
"version": "4.0.0",
|
||||
"version": "4.2.0",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
@@ -17,12 +17,12 @@
|
||||
"@actions/io": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/node": "^18.11.10",
|
||||
"@typescript-eslint/parser": "^5.44.0",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"eslint-plugin-github": "^4.4.1",
|
||||
"eslint-plugin-jest": "^27.1.6",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint": "^8.29.0",
|
||||
"jest": "^29.3.1",
|
||||
"prettier": "^2.8.0",
|
||||
"typescript": "^4.9.3"
|
||||
|
||||
+3
-1
@@ -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`)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import {exec} from '@actions/exec'
|
||||
|
||||
export const run = async (cmd: string, {cwd}: {cwd: string}) => {
|
||||
await exec('yarn', [cmd], {cwd})
|
||||
await exec('yarn', cmd.split(' '), {cwd})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user