@@ -131,25 +131,6 @@ func (c *Controller) getNotifier(ctx context.Context) (notifier.Notifier, error)
131131		}
132132		labels  =  a 
133133	}
134- 	// Write output to file instead of github comment 
135- 	if  c .Config .Output  !=  ""  {
136- 		client , err  :=  localfile .NewClient (& localfile.Config {
137- 			OutputFile :         c .Config .Output ,
138- 			Parser :             c .Parser ,
139- 			UseRawOutput :       c .Config .Terraform .UseRawOutput ,
140- 			CI :                 c .Config .CI .Link ,
141- 			Template :           c .Template ,
142- 			ParseErrorTemplate : c .ParseErrorTemplate ,
143- 			Vars :               c .Config .Vars ,
144- 			EmbeddedVarNames :   c .Config .EmbeddedVarNames ,
145- 			Templates :          c .Config .Templates ,
146- 			Masks :              c .Config .Masks ,
147- 		})
148- 		if  err  !=  nil  {
149- 			return  nil , err 
150- 		}
151- 		return  client .Notify , nil 
152- 	}
153134	client , err  :=  github .NewClient (ctx , & github.Config {
154135		BaseURL :         c .Config .GHEBaseURL ,
155136		GraphQLEndpoint : c .Config .GHEGraphQLEndpoint ,
@@ -176,5 +157,25 @@ func (c *Controller) getNotifier(ctx context.Context) (notifier.Notifier, error)
176157	if  err  !=  nil  {
177158		return  nil , err 
178159	}
160+ 	// Write output to file instead of github comment 
161+ 	if  c .Config .Output  !=  ""  {
162+ 		client , err  :=  localfile .NewClient (& localfile.Config {
163+ 			OutputFile :         c .Config .Output ,
164+ 			Parser :             c .Parser ,
165+ 			UseRawOutput :       c .Config .Terraform .UseRawOutput ,
166+ 			CI :                 c .Config .CI .Link ,
167+ 			Template :           c .Template ,
168+ 			ParseErrorTemplate : c .ParseErrorTemplate ,
169+ 			Vars :               c .Config .Vars ,
170+ 			EmbeddedVarNames :   c .Config .EmbeddedVarNames ,
171+ 			Templates :          c .Config .Templates ,
172+ 			Masks :              c .Config .Masks ,
173+ 			DisableLabel :       c .Config .Terraform .Plan .DisableLabel ,
174+ 		}, client .Notify )
175+ 		if  err  !=  nil  {
176+ 			return  nil , err 
177+ 		}
178+ 		return  client .Notify , nil 
179+ 	}
179180	return  client .Notify , nil 
180181}
0 commit comments