Skip to content

Commit

Permalink
set the right annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
yimysty committed Oct 20, 2023
1 parent 1e8be5b commit 84a94c4
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#
####################################################################################################

set -o errexit

SOURCE_DIRECTORY=${GITHUB_WORKSPACE}/$INPUT_SOURCE
DESTINATION_DIRECTORY=${GITHUB_WORKSPACE}/$INPUT_DESTINATION
PAGES_GEM_HOME=$BUNDLE_APP_CONFIG
Expand Down Expand Up @@ -40,4 +38,21 @@ else
fi

cd "$PAGES_GEM_HOME"
$GITHUB_PAGES_BIN build "$VERBOSE" "$FUTURE" --source "$SOURCE_DIRECTORY" --destination "$DESTINATION_DIRECTORY"

# Run the command, capturing the output
build_output="$($GITHUB_PAGES_BIN build "$VERBOSE" "$FUTURE" --source "$SOURCE_DIRECTORY" --destination "$DESTINATION_DIRECTORY")"

# Capture the exit code
exit_code=$?

if [ $exit_code -ne 0 ]; then
# Remove the newlines from the build_output as annotation not support multiline
error=$(echo "$build_output" | tr '\n' ' ' | tr -s ' ')
echo "::error::$error"
else
# Display the build_output directly
echo "$build_output"
fi

# Exit with the captured exit code
exit $exit_code

0 comments on commit 84a94c4

Please sign in to comment.