File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
main/kotlin/io/github/typesafegithub/workflows/yaml
test/kotlin/io/github/typesafegithub/workflows Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,12 @@ internal fun WorkflowBuilder.consistencyCheckJob(
3737 condition = consistencyCheckJobConfig.condition,
3838 env = consistencyCheckJobConfig.env,
3939 ) {
40- val checkoutActionVersion = when (consistencyCheckJobConfig.checkoutActionVersion) {
41- CheckoutActionVersionSource .BundledWithLibrary -> " v4"
42- is CheckoutActionVersionSource .Given -> consistencyCheckJobConfig.checkoutActionVersion.version
43- CheckoutActionVersionSource .InferredFromClasspath -> inferCheckoutActionVersionFromClasspath()
44- }
40+ val checkoutActionVersion =
41+ when (consistencyCheckJobConfig.checkoutActionVersion) {
42+ CheckoutActionVersionSource .BundledWithLibrary -> " v4"
43+ is CheckoutActionVersionSource .Given -> consistencyCheckJobConfig.checkoutActionVersion.version
44+ CheckoutActionVersionSource .InferredFromClasspath -> inferCheckoutActionVersionFromClasspath()
45+ }
4546
4647 uses(
4748 name = " Check out" ,
@@ -108,6 +109,9 @@ internal fun WorkflowBuilder.consistencyCheckJob(
108109
109110private fun inferCheckoutActionVersionFromClasspath (): String {
110111 val clazz = Class .forName(" io.github.typesafegithub.workflows.actions.actions.Checkout" )
111- val jarName = clazz.protectionDomain.codeSource.location.toString().substringAfterLast(" /" )
112+ val jarName =
113+ clazz.protectionDomain.codeSource.location
114+ .toString()
115+ .substringAfterLast(" /" )
112116 return jarName.substringAfterLast(" -" ).substringBeforeLast(" ." )
113117}
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ public sealed interface ConsistencyCheckJobConfig {
3636
3737public sealed interface CheckoutActionVersionSource {
3838 public object BundledWithLibrary : CheckoutActionVersionSource
39+
3940 public object InferredFromClasspath : CheckoutActionVersionSource
40- public class Given (public val version : String ) : CheckoutActionVersionSource
41+
42+ public class Given (
43+ public val version : String ,
44+ ) : CheckoutActionVersionSource
4145}
Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ class IntegrationTest :
384384 sourceFile = sourceTempFile,
385385 consistencyCheckJobConfig =
386386 DEFAULT_CONSISTENCY_CHECK_JOB_CONFIG .copy(
387- checkoutActionVersion = CheckoutActionVersionSource .InferredFromClasspath
387+ checkoutActionVersion = CheckoutActionVersionSource .InferredFromClasspath ,
388388 ),
389389 ) {
390390 job(
You can’t perform that action at this time.
0 commit comments