diff --git a/action.yml b/action.yml index 74da575..c3aa0b4 100644 --- a/action.yml +++ b/action.yml @@ -132,13 +132,37 @@ runs: shell: bash working-directory: ${{ inputs.working-directory }} run: | + print_assignment() { + printf '%s=' "$1" + tr '\n' ' ' + printf '\n' + } + { - echo "stack-query-arguments=$( echo "${{ inputs.query-arguments }}" | tr '\n' ' ')" - echo "stack-path-arguments=$( echo "${{ inputs.path-arguments }}" | tr '\n' ' ')" - echo "stack-setup-arguments=$( echo "${{ inputs.setup-arguments }}" | tr '\n' ' ')" - echo "stack-build-arguments-dependencies=$(echo "${{ inputs.stack-build-arguments }} ${{ inputs.stack-build-arguments-dependencies }}" | tr '\n' ' ')" - echo "stack-build-arguments-build=$( echo "${{ inputs.stack-build-arguments }} ${{ inputs.stack-build-arguments-build }}" | tr '\n' ' ')" - echo "stack-build-arguments-test=$( echo "${{ inputs.stack-build-arguments }} ${{ inputs.stack-build-arguments-test }}" | tr '\n' ' ')" + print_assignment "stack-query-arguments" <> "$GITHUB_OUTPUT" has_resolver() { @@ -155,7 +179,10 @@ runs: echo "resolver-nightly=$resolver_nightly" >>"$GITHUB_OUTPUT" - echo "stack-arguments=--stack-yaml ${{ inputs.stack-yaml }} $resolver_nightly $(echo "${{ inputs.stack-arguments }}" | tr '\n' ' ')" >>"$GITHUB_OUTPUT" + print_assignment "stack-arguments" >> "$GITHUB_OUTPUT" <>"$GITHUB_OUTPUT" # We can't just list out '**/.stack-work' because the files may not