From 8286341350ed0973901b8918bb76bcf93fcfff56 Mon Sep 17 00:00:00 2001 From: Blayne Chard Date: Fri, 3 Sep 2021 18:39:14 +1200 Subject: [PATCH] fix: list inputs are not supported use a comman seperated list --- README.md | 3 +-- action.yml | 2 +- package.json | 2 +- src/{index.ts => action.ts} | 5 ++--- 4 files changed, 5 insertions(+), 7 deletions(-) rename src/{index.ts => action.ts} (67%) diff --git a/README.md b/README.md index d21f6e2..35bf1b0 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,5 @@ Add the following snippet to a github action # Defaults to './package.json' package-json: tests/single-missing/package.json # Ignore packages - package-ignore: - - "@basemaps/test" + package-ignore: "aws-cdk, @aws-cdk/core" ``` \ No newline at end of file diff --git a/action.yml b/action.yml index b808ced..b0145aa 100644 --- a/action.yml +++ b/action.yml @@ -9,4 +9,4 @@ inputs: required: false runs: using: "node12" - main: "dist/index.js" + main: "dist/action.js" diff --git a/package.json b/package.json index c81b292..b932533 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "tsc --pretty", "lint": "eslint 'src/**/*.ts' --quiet --fix", "test": "ospec build/**/*.test.js", - "bundle": "npx esbuild src/index.ts --bundle --outdir=dist/ --platform=node" + "bundle": "npx esbuild src/action.ts --bundle --outdir=dist/ --platform=node" }, "dependencies": { "@actions/core": "^1.5.0", diff --git a/src/index.ts b/src/action.ts similarity index 67% rename from src/index.ts rename to src/action.ts index 5cb9c05..525b2fc 100644 --- a/src/index.ts +++ b/src/action.ts @@ -2,9 +2,8 @@ import * as core from '@actions/core'; import { ImportChecker } from './import.checker'; export async function main(): Promise { - const checker = new ImportChecker(core.getInput('package-json'), { - ignorePackages: new Set(core.getMultilineInput('package-ignore')), - }); + const ignorePackages = new Set((core.getInput('package-ignore') ?? '').split(',').map((c) => c.trim())); + const checker = new ImportChecker(core.getInput('package-json'), { ignorePackages }); await checker.check(); }