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 6
6
#
7
7
# ###################################################################################################
8
8
9
- set -o errexit
10
-
11
9
SOURCE_DIRECTORY=${GITHUB_WORKSPACE} /$INPUT_SOURCE
12
10
DESTINATION_DIRECTORY=${GITHUB_WORKSPACE} /$INPUT_DESTINATION
13
11
PAGES_GEM_HOME=$BUNDLE_APP_CONFIG
39
37
FUTURE=' '
40
38
fi
41
39
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