Skip to content

Commit

Permalink
refactor: improves handling of flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Jun 2, 2023
1 parent 34a1392 commit d2105c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Expand Up @@ -22,6 +22,4 @@ jobs:
aws_region: ${{ env.AWS_REGION }}
earthly_version: 0.7.6
- uses: actions/checkout@v3
- uses: input-output-hk/catalyst-ci/actions/discover@actions
with:
targets: docker
- uses: input-output-hk/catalyst-ci/actions/discover@actions
17 changes: 13 additions & 4 deletions actions/discover/action.yml
@@ -1,6 +1,10 @@
name: CI Discovery
description: Discovers Earthfiles in the given paths and compiles data about them
inputs:
parse_images:
description: Whether the image names from the given targets should be returnd (requires at least one target)
required: false
default: "false"
paths:
description: A space separated list of paths to search
required: false
Expand All @@ -13,14 +17,19 @@ inputs:
runs:
using: composite
steps:
- name: Discovers
- name: Discover
shell: bash
id: discover
run: |
TARGET_FLAGS=()
FLAGS=("-j")
if [[ "${{ inputs.parse_images }}" -eq "true" ]]; then
FLAGS+="-i"
fi
for target in ${{ inputs.targets }}; do
TARGET_FLAGS+=("-t" "$target")
FLAGS+=("-t" "$target")
done
JSON_OUTPUT=$(ci scan -j -i "${TARGET_FLAGS[@]}" ${{ inputs.paths }})
JSON_OUTPUT=$(ci scan "${FLAGS[@]}" ${{ inputs.paths }})
echo "$JSON_OUTPUT"

0 comments on commit d2105c0

Please sign in to comment.