Skip to content

Commit

Permalink
wip: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Aug 30, 2024
1 parent 6b9064d commit 3ce9daf
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
6 changes: 6 additions & 0 deletions forge/actions/discovery/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Discovery
description: Discovers Earthfiles
inputs:
absolute:
description: Output absolute paths
default: "false"
enumerate:
description: Enumerate results into Earthfile+Target pairs
default: "true"
filters:
description: A newline separated list of filters to apply
default: ""
Expand Down
13 changes: 12 additions & 1 deletion forge/actions/discovery/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion forge/actions/discovery/dist/index.js.map

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion forge/actions/discovery/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@ const exec = require("@actions/exec");

async function run() {
try {
const absolute = core.getBooleanInput("absolute", { required: false });
const enumerate = core.getBooleanInput("enumerate", { required: false });
const path = core.getInput("path", { required: true });
const filters = core.getInput("filters", { required: false });

let args = ["-vv", "scan"];

if (absolute === true) {
args.push("--absolute");
}

if (enumerate === true) {
args.push("--enumerate");
}

args = args.concat(filtersToArgs(filters));
args.push(path);

Expand Down Expand Up @@ -37,7 +48,7 @@ function filtersToArgs(input) {

const result = [];
for (const line of lines) {
result.push("-f", line);
result.push("--filter", line);
}

return result;
Expand Down

0 comments on commit 3ce9daf

Please sign in to comment.