@@ -363,18 +363,19 @@ class GenerativePluginSpec extends Specification {
363
363
UseRef .Public (
364
364
" repo" ,
365
365
" slug" ,
366
+ " rev" ,
366
367
" v0" )),
367
368
" " ,
368
369
Nil ,
369
- declareShell = true ) mustEqual " - uses: repo/slug@v0"
370
+ declareShell = true ) mustEqual " - uses: repo/slug@rev # v0"
370
371
}
371
372
372
373
" preserve wonky version in Use" in {
373
- compileStep(
Use (
UseRef .
Public (
" hello" ,
" world" ,
" v4.0.0" )),
" " ,
Nil , declareShell
= true ) mustEqual
" - uses: hello/[email protected] "
374
+ compileStep(Use (UseRef .Public (" hello" , " world" , " rev " , " v4.0.0" )), " " , Nil , declareShell = true ) mustEqual " - uses: hello/world@rev # v4.0.0"
374
375
}
375
376
376
377
" drop Use version prefix on anything that doesn't start with a number" in {
377
- compileStep(Use (UseRef .Public (" hello" , " world" , " main" )), " " , Nil , declareShell = true ) mustEqual " - uses: hello/world@main"
378
+ compileStep(Use (UseRef .Public (" hello" , " world" , " rev " , " main" )), " " , Nil , declareShell = true ) mustEqual " - uses: hello/world@rev # main"
378
379
}
379
380
380
381
" compile sbt using the command provided" in {
@@ -402,8 +403,8 @@ class GenerativePluginSpec extends Specification {
402
403
" compile use without parameters" in {
403
404
" public" >> {
404
405
compileStep(
405
- Use (UseRef .Public (" olafurpg" , " setup-scala" , " v13" )),
406
- " " ) mustEqual " - uses: olafurpg/setup-scala@v13"
406
+ Use (UseRef .Public (" olafurpg" , " setup-scala" , " rev " , " v13" )),
407
+ " " ) mustEqual " - uses: olafurpg/setup-scala@rev # v13"
407
408
}
408
409
409
410
" directory" >> {
@@ -435,8 +436,8 @@ class GenerativePluginSpec extends Specification {
435
436
436
437
" compile use with two parameters" in {
437
438
compileStep(
438
- Use (UseRef .Public (" olafurpg" , " setup-scala" , " v13" ), params = Map (" abc" -> " def" , " cafe" -> " @42" )),
439
- " " ) mustEqual " - uses: olafurpg/setup-scala@v13\n with:\n abc: def\n cafe: '@42'"
439
+ Use (UseRef .Public (" olafurpg" , " setup-scala" , " rev " , " v13" ), params = Map (" abc" -> " def" , " cafe" -> " @42" )),
440
+ " " ) mustEqual " - uses: olafurpg/setup-scala@rev # v13\n with:\n abc: def\n cafe: '@42'"
440
441
}
441
442
442
443
" compile use with two parameters and environment variables" in {
@@ -445,10 +446,11 @@ class GenerativePluginSpec extends Specification {
445
446
UseRef .Public (
446
447
" derp" ,
447
448
" nope" ,
449
+ " rev" ,
448
450
" v0" ),
449
451
params = Map (" teh" -> " schizzle" , " think" -> " positive" ),
450
452
env = Map (" hi" -> " there" )),
451
- " " ) mustEqual " - env:\n hi: there\n uses: derp/nope@v0\n with:\n teh: schizzle\n think: positive"
453
+ " " ) mustEqual " - env:\n hi: there\n uses: derp/nope@rev # v0\n with:\n teh: schizzle\n think: positive"
452
454
}
453
455
454
456
" compile a run step with multiple commands" in {
@@ -516,7 +518,7 @@ class GenerativePluginSpec extends Specification {
516
518
- run: echo hello
517
519
518
520
- name: Checkout current branch (fast)
519
- uses: actions/checkout@v4 """
521
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 """
520
522
}
521
523
522
524
" compile a job with one step and three oses" in {
@@ -565,15 +567,15 @@ class GenerativePluginSpec extends Specification {
565
567
steps:
566
568
- name: Setup Java (temurin@17)
567
569
if: matrix.java == 'temurin@17'
568
- uses: actions/setup-java@v4
570
+ uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
569
571
with:
570
572
distribution: temurin
571
573
java-version: 17
572
574
cache: sbt
573
575
574
576
- name: Setup GraalVM (graal_22.3.0@11)
575
577
if: matrix.java == 'graal_22.3.0@11'
576
- uses: graalvm/setup-graalvm@v1
578
+ uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3
577
579
with:
578
580
version: 22.3.0
579
581
java-version: 11
@@ -605,7 +607,7 @@ class GenerativePluginSpec extends Specification {
605
607
steps:
606
608
- name: Setup GraalVM (graal_graalvm@17)
607
609
if: matrix.java == 'graal_graalvm@17'
608
- uses: graalvm/setup-graalvm@v1
610
+ uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3
609
611
with:
610
612
java-version: 17
611
613
distribution: graalvm
@@ -777,7 +779,7 @@ class GenerativePluginSpec extends Specification {
777
779
- run: echo $$ {{ matrix.test }}
778
780
779
781
- name: Checkout current branch (fast)
780
- uses: actions/checkout@v4 """
782
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 """
781
783
}
782
784
783
785
" compile a job with extra runs-on labels" in {
@@ -1000,7 +1002,7 @@ class GenerativePluginSpec extends Specification {
1000
1002
- run: echo hello
1001
1003
1002
1004
- name: Checkout current branch (fast)
1003
- uses: actions/checkout@v4 """
1005
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 """
1004
1006
}
1005
1007
}
1006
1008
0 commit comments