Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
Support several test report paths (#3)
Browse files Browse the repository at this point in the history
* Avoid using --path flag

* Apply suggestions from PR feedback

* Update README.md
  • Loading branch information
drodriguezhdez authored Apr 21, 2020
1 parent 84ac497 commit c7d2b28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ The Scope Import tool is compatible with the following test reports:
uses: undefinedlabs/scope-import-action@v1
with:
dsn: ${{ secrets.SCOPE_DSN }}
path: path/to/test-reports
path: |
path/to/test-reports01
path/to/test-reports02
```
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ function run() {
try {
let dsn = core.getInput("dsn", { required: true });
yield core.exportVariable("SCOPE_DSN", dsn);
let pathVar = core.getInput("path", { required: true });
const pathVar = core.getInput("path", { required: true }).replace(/[\r\n]/gm, " ");
const platform = IS_WINDOWS ? "windows" : IS_MACOS ? "darwin" : "linux";
let scopeImportToolPath;
scopeImportToolPath = yield tc.downloadTool("https://home.undefinedlabs.com/download/scope-import/" +
Expand All @@ -1699,7 +1699,7 @@ function run() {
else {
yield exec.exec("chmod +x " + scopeImportToolPath);
}
yield exec.exec(scopeImportToolPath + " --path " + pathVar);
yield exec.exec(scopeImportToolPath + " " + pathVar);
}
catch (error) {
core.setFailed(error.message);
Expand Down
4 changes: 2 additions & 2 deletions src/scope-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function run() {
let dsn = core.getInput("dsn", { required: true });
await core.exportVariable("SCOPE_DSN", dsn);

let pathVar = core.getInput("path", { required: true });
const pathVar = core.getInput("path", { required: true }).replace(/[\r\n]/gm, " ");
const platform = IS_WINDOWS ? "windows" : IS_MACOS ? "darwin" : "linux";

let scopeImportToolPath;
Expand All @@ -27,7 +27,7 @@ async function run() {
} else {
await exec.exec("chmod +x " + scopeImportToolPath);
}
await exec.exec(scopeImportToolPath + " --path " + pathVar);
await exec.exec(scopeImportToolPath + " " + pathVar);
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit c7d2b28

Please sign in to comment.