Compare commits

..

12 Commits

Author SHA1 Message Date
Borales 97ba8bebfe Added proper support for multiple arguments 2022-12-05 21:31:43 +01:00
Oleksandr Bordun d8b5ea8c26 Merge pull request #61 from Borales/renovate/eslint-8.x
Update dependency eslint to ^8.29.0
2022-12-05 21:02:01 +01:00
renovate[bot] ac4aa8b421 Update dependency eslint to ^8.29.0 2022-12-03 01:23:11 +00:00
Oleksandr Bordun d0b398ccef Merge pull request #60 from Borales/renovate/node-18.x
Update dependency @types/node to ^18.11.10
2022-12-02 22:37:02 +01:00
renovate[bot] 32394b360b Update dependency @types/node to ^18.11.10 2022-11-30 20:59:09 +00:00
Borales b257940aaa Adding readme note 2022-11-27 21:37:50 +01:00
Oleksandr Bordun 062383b267 Merge pull request #57 from Borales/renovate/configure
Configure Renovate
2022-11-27 16:24:05 +01:00
Borales d236877258 Updating renovate config 2022-11-27 16:22:16 +01:00
renovate[bot] 21a4e475d0 Add renovate.json 2022-11-27 15:10:36 +00:00
Borales 16098ef84e Updating readme 2022-11-26 23:40:08 +01:00
Oleksandr Bordun 9e77a0618b Merge pull request #56 from Borales/dir
Adding "dir" option
2022-11-26 23:37:02 +01:00
Borales 17af3bf048 Adding "dir" option 2022-11-26 23:35:32 +01:00
10 changed files with 56 additions and 23 deletions
+13
View File
@@ -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"
}
]
}
+8
View File
@@ -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
+11
View File
@@ -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
View File
@@ -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 -2
View File
@@ -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;
+1 -1
View File
File diff suppressed because one or more lines are too long
+8 -8
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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})
}