@@ -121,18 +121,26 @@ async function runLint(lintPath: string, patchPath: string): Promise<void> {
121
121
const userArgs = core . getInput ( `args` )
122
122
const addedArgs : string [ ] = [ ]
123
123
124
- const userArgNames = new Set < string > (
125
- userArgs
126
- . trim ( )
127
- . split ( / \s + / )
128
- . map ( ( arg ) => arg . split ( `=` ) [ 0 ] )
129
- . filter ( ( arg ) => arg . startsWith ( `-` ) )
130
- . map ( ( arg ) => arg . replace ( / ^ - + / , `` ) )
131
- )
132
- if ( userArgNames . has ( `out-format` ) ) {
133
- throw new Error ( `please, don't change out-format for golangci-lint: it can be broken in a future` )
134
- }
135
- addedArgs . push ( `--out-format=github-actions` )
124
+ const userArgsList = userArgs
125
+ . trim ( )
126
+ . split ( / \s + / )
127
+ . filter ( ( arg ) => arg . startsWith ( `-` ) )
128
+ . map ( ( arg ) => arg . replace ( / ^ - + / , `` ) )
129
+ . map ( ( arg ) => arg . split ( / = ( .* ) / , 2 ) )
130
+ . map < [ string , string ] > ( ( [ key , value ] ) => [ key . toLowerCase ( ) , value ?? "" ] )
131
+
132
+ const userArgsMap = new Map < string , string > ( userArgsList )
133
+ const userArgNames = new Set < string > ( userArgsList . map ( ( [ key ] ) => key ) )
134
+
135
+ const formats = ( userArgsMap . get ( "out-format" ) || "" )
136
+ . trim ( )
137
+ . split ( "," )
138
+ . filter ( ( f ) => f . length > 0 )
139
+ . filter ( ( f ) => ! f . startsWith ( `github-actions` ) )
140
+ . concat ( "github-actions" )
141
+ . join ( "," )
142
+
143
+ addedArgs . push ( `--out-format=${ formats } ` )
136
144
137
145
if ( patchPath ) {
138
146
if ( userArgNames . has ( `new` ) || userArgNames . has ( `new-from-rev` ) || userArgNames . has ( `new-from-patch` ) ) {
0 commit comments