File tree Expand file tree Collapse file tree
packages/app/src/docker-git Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,6 +116,15 @@ const renderNestedStatusPayload = (
116116 return readNestedMessage ( object , "status" ) ?? JSON . stringify ( payload , null , 2 )
117117}
118118
119+ const renderDirectObjectPayload = ( object : JsonObject ) : string | null => {
120+ const directStatus = renderGithubStatusLike ( object )
121+ if ( directStatus !== null ) {
122+ return directStatus
123+ }
124+
125+ return asString ( object [ "message" ] )
126+ }
127+
119128export const renderJsonPayload = ( payload : JsonValue ) : string => {
120129 if ( typeof payload === "string" ) {
121130 return payload
@@ -126,14 +135,9 @@ export const renderJsonPayload = (payload: JsonValue): string => {
126135 return JSON . stringify ( payload , null , 2 )
127136 }
128137
129- const directStatus = renderGithubStatusLike ( object )
130- if ( directStatus !== null ) {
131- return directStatus
132- }
133-
134- const message = asString ( object [ "message" ] )
135- if ( message !== null ) {
136- return message
138+ const directPayload = renderDirectObjectPayload ( object )
139+ if ( directPayload !== null ) {
140+ return directPayload
137141 }
138142
139143 const nestedStatus = renderNestedStatusPayload ( payload , object )
You can’t perform that action at this time.
0 commit comments