@@ -15,7 +15,7 @@ setupTests(test);
1515test ( "getConfigFileInput returns undefined by default" , async ( t ) => {
1616 const logger = new RecordingLogger ( ) ;
1717 const actionsEnv = getTestActionsEnv ( ) ;
18- const result = getConfigFileInput ( logger , actionsEnv , { } ) ;
18+ const result = getConfigFileInput ( logger , actionsEnv , { } , true ) ;
1919 t . is ( result , undefined ) ;
2020} ) ;
2121
@@ -34,7 +34,12 @@ test("getConfigFileInput returns input value", async (t) => {
3434
3535 // Even though both an input and repository property are configured,
3636 // we prefer the direct input to the Action.
37- const result = getConfigFileInput ( logger , actionsEnv , repositoryProperties ) ;
37+ const result = getConfigFileInput (
38+ logger ,
39+ actionsEnv ,
40+ repositoryProperties ,
41+ true ,
42+ ) ;
3843 t . is ( result , testInput ) ;
3944
4045 // Check for the expected log message.
@@ -46,7 +51,12 @@ test("getConfigFileInput returns repository property value", async (t) => {
4651 const actionsEnv = getTestActionsEnv ( ) ;
4752
4853 // Since there is no direct input, we should use the repository property.
49- const result = getConfigFileInput ( logger , actionsEnv , repositoryProperties ) ;
54+ const result = getConfigFileInput (
55+ logger ,
56+ actionsEnv ,
57+ repositoryProperties ,
58+ true ,
59+ ) ;
5060 t . is ( result , repositoryProperties [ RepositoryPropertyName . CONFIG_FILE ] ) ;
5161
5262 // Check for the expected log message.
@@ -62,8 +72,38 @@ test("getConfigFileInput ignores empty repository property value", async (t) =>
6272 const actionsEnv = getTestActionsEnv ( ) ;
6373
6474 // Since the repository property value is an empty/whitespace string, we should ignore it.
65- const result = getConfigFileInput ( logger , actionsEnv , {
66- [ RepositoryPropertyName . CONFIG_FILE ] : " " ,
67- } ) ;
75+ const result = getConfigFileInput (
76+ logger ,
77+ actionsEnv ,
78+ {
79+ [ RepositoryPropertyName . CONFIG_FILE ] : " " ,
80+ } ,
81+ true ,
82+ ) ;
83+ t . is ( result , undefined ) ;
84+ } ) ;
85+
86+ test ( "getConfigFileInput ignores repository property value when FF is off" , async ( t ) => {
87+ const logger = new RecordingLogger ( ) ;
88+ const actionsEnv = getTestActionsEnv ( ) ;
89+
90+ // Since the FF is off, we should ignore the repository property value.
91+ const result = getConfigFileInput (
92+ logger ,
93+ actionsEnv ,
94+ repositoryProperties ,
95+ false ,
96+ ) ;
6897 t . is ( result , undefined ) ;
98+
99+ t . false (
100+ logger . hasMessage (
101+ "Using configuration file input from repository property" ,
102+ ) ,
103+ ) ;
104+ t . true (
105+ logger . hasMessage (
106+ "Ignoring configuration file input from repository property, because the corresponding feature flag is disabled." ,
107+ ) ,
108+ ) ;
69109} ) ;
0 commit comments