File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 66#
77# ###################################################################################################
88
9- set -o errexit
10-
119SOURCE_DIRECTORY=${GITHUB_WORKSPACE} /$INPUT_SOURCE
1210DESTINATION_DIRECTORY=${GITHUB_WORKSPACE} /$INPUT_DESTINATION
1311PAGES_GEM_HOME=$BUNDLE_APP_CONFIG
3937 FUTURE=' '
4038fi
4139
42- cd " $PAGES_GEM_HOME "
43- $GITHUB_PAGES_BIN build " $VERBOSE " " $FUTURE " --source " $SOURCE_DIRECTORY " --destination " $DESTINATION_DIRECTORY "
40+ { cd " $PAGES_GEM_HOME " || { echo " ::error::pages gem not found" ; exit 1; }; }
41+
42+ # Run the command, capturing the output
43+ build_output=" $( $GITHUB_PAGES_BIN build " $VERBOSE " " $FUTURE " --source " $SOURCE_DIRECTORY " --destination " $DESTINATION_DIRECTORY " ) "
44+
45+ # Capture the exit code
46+ exit_code=$?
47+
48+ if [ $exit_code -ne 0 ]; then
49+ # Remove the newlines from the build_output as annotation not support multiline
50+ error=$( echo " $build_output " | tr ' \n' ' ' | tr -s ' ' )
51+ echo " ::error::$error "
52+ else
53+ # Display the build_output directly
54+ echo " $build_output "
55+ fi
56+
57+ # Exit with the captured exit code
58+ exit $exit_code
You can’t perform that action at this time.
0 commit comments