@@ -25,6 +25,7 @@ describe('workers/repository/init/inherited', () => {
25
25
inheritConfigFileName : 'config.json' ,
26
26
inheritConfigStrict : false ,
27
27
} ;
28
+ hostRules . clear ( ) ;
28
29
} ) ;
29
30
30
31
it ( 'should return the same config if repository or inheritConfig is not defined' , async ( ) => {
@@ -112,6 +113,30 @@ describe('workers/repository/init/inherited', () => {
112
113
expect ( res . hostRules ) . toBeUndefined ( ) ;
113
114
} ) ;
114
115
116
+ it ( 'should apply secrets to inherited config' , async ( ) => {
117
+ platform . getRawFile . mockResolvedValue (
118
+ `{
119
+ "hostRules": [
120
+ {
121
+ "matchHost": "some-host-url",
122
+ "token": "{{ secrets.SECRET_TOKEN }}"
123
+ }
124
+ ]
125
+ }` ,
126
+ ) ;
127
+ const res = await mergeInheritedConfig ( {
128
+ ...config ,
129
+ secrets : { SECRET_TOKEN : 'some-secret-token' } ,
130
+ } ) ;
131
+ expect ( hostRules . getAll ( ) ) . toMatchObject ( [
132
+ {
133
+ matchHost : 'some-host-url' ,
134
+ token : 'some-secret-token' ,
135
+ } ,
136
+ ] ) ;
137
+ expect ( res . hostRules ) . toBeUndefined ( ) ;
138
+ } ) ;
139
+
115
140
it ( 'should resolve presets found in inherited config' , async ( ) => {
116
141
platform . getRawFile . mockResolvedValue (
117
142
'{"onboarding":false,"labels":["test"],"extends":[":automergeAll"]}' ,
0 commit comments