Files
common/mono/mono/entrypoint.sh
2025-06-24 15:24:16 -07:00

21 lines
443 B
Bash

#!/bin/bash
COMMAND="$@"
PROGRAM=${PROGRAM:-"mono"}
OUTPUT=$(bash -c "$PROGRAM $COMMAND")
RESULT=$?
#Output multiline strings.
#https://trstringer.com/github-actions-multiline-strings/
if [[ -n "$OUTPUT" ]]; then
echo "console<<EOF" >> "$GITHUB_OUTPUT"
echo "$OUTPUT" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
fi
echo "exitCode=$RESULT" >> "$GITHUB_OUTPUT"
if [[ "$CATCH_ERRORS" != "true" ]]; then
exit $RESULT
fi