File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ inputs:
2424 required : false
2525 default : " ."
2626
27+ outputs :
28+ commit-url :
29+ description : The URL of the created commit.
30+ commit-hash :
31+ description : The hash of the created commit.
32+
2733runs :
2834 using : " docker"
2935 image : " Dockerfile"
Original file line number Diff line number Diff line change @@ -74,4 +74,14 @@ ghcommit_args+=("${deletes[@]/#/--delete=}")
7474
7575[[ -n " ${DEBUG:- } " ]] && echo " ghcommit args: '${ghcommit_args[*]} '"
7676
77- ghcommit " ${ghcommit_args[@]} "
77+ output=$( ghcommit " ${ghcommit_args[@]} " 2>&1 ) || {
78+ # Show the output on error. This is needed since the exit immediately flag is set.
79+ echo " $output " 1>&2 ;
80+ exit 1
81+ }
82+ echo " $output "
83+
84+ commit_url=$( echo " $output " | grep " Success. New commit:" | awk ' {print $NF}' )
85+ commit_hash=$( echo " $commit_url " | awk -F ' /' ' {print $NF}' )
86+ echo " commit-url=$commit_url " >> " $GITHUB_OUTPUT "
87+ echo " commit-hash=$commit_hash " >> " $GITHUB_OUTPUT "
You can’t perform that action at this time.
0 commit comments