@@ -198,88 +198,94 @@ function extractRunners(runner: unknown): PackageDependency[] {
198
198
return runners . map ( extractRunner ) . filter ( isNotNullOrUndefined ) ;
199
199
}
200
200
201
- const communityActions = [
202
- {
203
- // https://github.com/jaxxstorm/action-install-gh-release
204
- use : / ^ j a x x s t o r m \/ a c t i o n - i n s t a l l - g h - r e l e a s e @ .* $ / ,
205
- schema : z
206
- . object ( { with : z . object ( { repo : z . string ( ) , tag : z . string ( ) } ) } )
207
- . transform ( ( { with : val } ) : PackageDependency => {
208
- return {
209
- datasource : GithubReleasesDatasource . id ,
210
- depName : val . repo ,
211
- packageName : val . repo ,
212
- currentValue : val . tag ,
213
- depType : 'uses-with' ,
214
- } ;
215
- } ) ,
216
- } ,
217
- {
218
- // https://github.com/astral-sh/setup-uv
219
- use : / ^ a s t r a l - s h \/ s e t u p - u v @ .* $ / ,
220
- schema : z
221
- . object ( { with : z . object ( { version : z . string ( ) } ) } )
222
- . transform ( ( { with : val } ) : PackageDependency | undefined => {
223
- if ( val . version === 'latest' ) {
224
- return ;
225
- }
201
+ const communityActions = z . union ( [
202
+ z
203
+ . object ( {
204
+ // https://github.com/jaxxstorm/action-install-gh-release
205
+ uses : z
206
+ . string ( )
207
+ . regex (
208
+ / ^ ( h t t p s : \/ \/ g i t h u b \. c o m \/ ) ? j a x x s t o r m \/ a c t i o n - i n s t a l l - g h - r e l e a s e @ .* $ / ,
209
+ ) ,
210
+ with : z . object ( { repo : z . string ( ) , tag : z . string ( ) } ) ,
211
+ } )
212
+ . transform ( ( { with : val } ) : PackageDependency => {
213
+ return {
214
+ datasource : GithubReleasesDatasource . id ,
215
+ depName : val . repo ,
216
+ packageName : val . repo ,
217
+ currentValue : val . tag ,
218
+ depType : 'uses-with' ,
219
+ } ;
220
+ } ) ,
221
+ z
222
+ . object ( {
223
+ // https://github.com/astral-sh/setup-uv
224
+ uses : z
225
+ . string ( )
226
+ . regex ( / ^ ( h t t p s : \/ \/ g i t h u b \. c o m \/ ) ? a s t r a l - s h \/ s e t u p - u v @ .* $ / ) ,
227
+ with : z . object ( { version : z . string ( ) } ) ,
228
+ } )
229
+ . transform ( ( { with : val } ) : PackageDependency | undefined => {
230
+ if ( val . version === 'latest' ) {
231
+ return ;
232
+ }
226
233
227
- return {
228
- datasource : GithubReleasesDatasource . id ,
229
- depName : 'astral-sh/uv' ,
230
- versioning : npmVersioning . id ,
231
- packageName : 'astral-sh/uv' ,
232
- currentValue : val . version ,
233
- depType : 'uses-with' ,
234
- } ;
234
+ return {
235
+ datasource : GithubReleasesDatasource . id ,
236
+ depName : 'astral-sh/uv' ,
237
+ versioning : npmVersioning . id ,
238
+ packageName : 'astral-sh/uv' ,
239
+ currentValue : val . version ,
240
+ depType : 'uses-with' ,
241
+ } ;
242
+ } ) ,
243
+ z
244
+ . object ( {
245
+ // https://github.com/pnpm/action-setup
246
+ uses : z
247
+ . string ( )
248
+ . regex ( / ^ ( h t t p s : \/ \/ g i t h u b \. c o m \/ ) ? p n p m \/ a c t i o n - s e t u p @ .* $ / ) ,
249
+ with : z . object ( {
250
+ version : z . union ( [
251
+ z . string ( ) ,
252
+ z . number ( ) . transform ( ( s ) => s . toString ( ) ) ,
253
+ ] ) ,
235
254
} ) ,
236
- } ,
237
- {
238
- // https://github.com/pnpm/action-setup
239
- use : / ^ p n p m \/ a c t i o n - s e t u p @ .* $ / ,
240
- schema : z
241
- . object ( {
242
- with : z . object ( {
243
- version : z . union ( [
244
- z . string ( ) ,
245
- z . number ( ) . transform ( ( s ) => s . toString ( ) ) ,
246
- ] ) ,
247
- } ) ,
248
- } )
249
- . transform ( ( { with : val } ) : PackageDependency | undefined => {
250
- if ( val . version === 'latest' ) {
251
- return ;
252
- }
255
+ } )
256
+ . transform ( ( { with : val } ) : PackageDependency | undefined => {
257
+ if ( val . version === 'latest' ) {
258
+ return ;
259
+ }
253
260
254
- return {
255
- datasource : NpmDatasource . id ,
256
- depName : 'pnpm' ,
257
- versioning : npmVersioning . id ,
258
- packageName : 'pnpm' ,
259
- currentValue : val . version ,
260
- depType : 'uses-with' ,
261
- } ;
262
- } ) ,
263
- } ,
264
- {
265
- // https://github.com/astral-sh/setup-uv
266
- use : / ^ p d m - p r o j e c t \/ s e t u p - p d m @ .* $ / ,
267
- schema : z
268
- . object ( {
269
- with : z . object ( { version : z . string ( ) . refine ( ( s ) => s !== 'head' ) } ) ,
270
- } )
271
- . transform ( ( { with : val } ) : PackageDependency | undefined => {
272
- return {
273
- datasource : PypiDatasource . id ,
274
- depName : 'pdm' ,
275
- versioning : pep440versioning . id ,
276
- packageName : 'pdm' ,
277
- currentValue : val . version ,
278
- depType : 'uses-with' ,
279
- } ;
280
- } ) ,
281
- } ,
282
- ] ;
261
+ return {
262
+ datasource : NpmDatasource . id ,
263
+ depName : 'pnpm' ,
264
+ versioning : npmVersioning . id ,
265
+ packageName : 'pnpm' ,
266
+ currentValue : val . version ,
267
+ depType : 'uses-with' ,
268
+ } ;
269
+ } ) ,
270
+ z
271
+ . object ( {
272
+ // https://github.com/astral-sh/setup-uv
273
+ uses : z
274
+ . string ( )
275
+ . regex ( / ^ ( h t t p s : \/ \/ g i t h u b \. c o m \/ ) ? p d m - p r o j e c t \/ s e t u p - p d m @ .* $ / ) ,
276
+ with : z . object ( { version : z . string ( ) . refine ( ( s ) => s !== 'head' ) } ) ,
277
+ } )
278
+ . transform ( ( { with : val } ) : PackageDependency | undefined => {
279
+ return {
280
+ datasource : PypiDatasource . id ,
281
+ depName : 'pdm' ,
282
+ versioning : pep440versioning . id ,
283
+ packageName : 'pdm' ,
284
+ currentValue : val . version ,
285
+ depType : 'uses-with' ,
286
+ } ;
287
+ } ) ,
288
+ ] ) ;
283
289
284
290
function extractWithYAMLParser (
285
291
content : string ,
@@ -335,13 +341,9 @@ function extractWithYAMLParser(
335
341
336
342
for ( const step of coerceArray ( job ?. steps ) ) {
337
343
if ( step . uses ) {
338
- for ( const action of communityActions ) {
339
- if ( action . use . test ( step . uses ) ) {
340
- const val = Result . parse ( step , action . schema ) . unwrapOrNull ( ) ;
341
- if ( val ) {
342
- deps . push ( val ) ;
343
- }
344
- }
344
+ const val = Result . parse ( step , communityActions ) . unwrapOrNull ( ) ;
345
+ if ( val ) {
346
+ deps . push ( val ) ;
345
347
}
346
348
}
347
349
0 commit comments