File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,6 +87,12 @@ describe('getInputList', () => {
8787 expect ( res ) . toEqual ( [ 'foo=bar' , 'bar=qux' ] ) ;
8888 } ) ;
8989
90+ it ( 'multiline with comment and no infix comment' , async ( ) => {
91+ setInput ( 'labels' , '# ignore this\nfoo=bar\nbar=qux#baz' ) ;
92+ const res = Util . getInputList ( 'labels' , { comment : '#' , commentNoInfix : true } ) ;
93+ expect ( res ) . toEqual ( [ 'foo=bar' , 'bar=qux#baz' ] ) ;
94+ } ) ;
95+
9096 it ( 'different new lines and ignoring comma correctly' , async ( ) => {
9197 setInput ( 'cache-from' , 'user/app:cache\r\ntype=local,src=path/to/dir' ) ;
9298 const res = Util . getInputList ( 'cache-from' , { ignoreComma : true } ) ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import {parse} from 'csv-parse/sync';
2424export interface ListOpts {
2525 ignoreComma ?: boolean ;
2626 comment ?: string ;
27+ commentNoInfix ?: boolean ;
2728 quote ?: string | boolean | Buffer | null ;
2829}
2930
@@ -42,6 +43,7 @@ export class Util {
4243 columns : false ,
4344 relaxQuotes : true ,
4445 comment : opts ?. comment ,
46+ comment_no_infix : opts ?. commentNoInfix ,
4547 relaxColumnCount : true ,
4648 skipEmptyLines : true ,
4749 quote : opts ?. quote
You can’t perform that action at this time.
0 commit comments