Skip to content

Commit

Permalink
fix: list inputs are not supported use a comman seperated list
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Sep 3, 2021
1 parent e1f9e73 commit 8286341
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ inputs:
required: false
runs:
using: "node12"
main: "dist/index.js"
main: "dist/action.js"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts → src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import * as core from '@actions/core';
import { ImportChecker } from './import.checker';

export async function main(): Promise<void> {
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();
}

Expand Down

0 comments on commit 8286341

Please sign in to comment.