Skip to content

Commit

Permalink
feat: adds output to discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Jun 2, 2023
1 parent c7a9c9b commit 3ef46f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -22,7 +22,12 @@ jobs:
aws_region: ${{ env.AWS_REGION }}
earthly_version: 0.7.6
- uses: actions/checkout@v3
- uses: input-output-hk/catalyst-ci/actions/discover@actions
- name: Discover
uses: input-output-hk/catalyst-ci/actions/discover@actions
id: discover
with:
parse_images: "true"
targets: docker
targets: docker
- name: Test
run: |
echo "${{ steps.discover.outputs.json}}"
12 changes: 11 additions & 1 deletion actions/discover/action.yml
Expand Up @@ -13,6 +13,10 @@ inputs:
description: A space seperated list of targets to filter against
required: false
default: ""
outputs:
json:
description: "JSON object containing information about discovered Earthfiles"
value: ${{ steps.discover.outputs.json }}

runs:
using: composite
Expand All @@ -32,4 +36,10 @@ runs:
done
JSON_OUTPUT=$(ci scan "${FLAGS[@]}" ${{ inputs.paths }})
echo "$JSON_OUTPUT"
if [[ "${{ inputs.parse_images }}" == "true" ]]; then
OUTPUT=$(echo "$JSON_OUTPUT" | jq -cr '[.[] | .images |= join(" ")]')
else
OUTPUT="${JSON_OUTPUT}"
fi
echo "json=$OUTPUT" >>$GITHUB_OUTPUT

0 comments on commit 3ef46f8

Please sign in to comment.