@@ -412,18 +412,24 @@ workflowWithCopyright(
412412 )
413413 executeActionStep= usesSelfAfterSuccess(
414414 name= " Set wsl-bash wrapper to use user test by default" ,
415+ // part of work-around for https://bugs.kali.org/view.php?id=8921
416+ conditionTransformer= { executeActionStep.successNotOnKaliCondition },
415417 action= executeAction.copy(
416418 additionalPackages= listOf (" sudo" ),
417419 wslShellCommand= """ bash -c "sudo -u test bash --noprofile --norc -euo pipefail "\"""
418420 )
419421 )
420422 verifyCommandResult(
421423 name= " Test - wsl-bash should use test as default user" ,
424+ // part of work-around for https://bugs.kali.org/view.php?id=8921
425+ conditionTransformer= { executeActionStep.successNotOnKaliCondition },
422426 actualCommand= " whoami" ,
423427 expected= " test"
424428 )
425429 executeActionStep= usesSelfAfterSuccess(
426430 name= " Set wsl-bash wrapper to use user test by default with inline script usage" ,
431+ // part of work-around for https://bugs.kali.org/view.php?id=8921
432+ conditionTransformer= { executeActionStep.successNotOnKaliCondition },
427433 action= executeAction.copy(
428434 wslShellCommand= """ bash -c "sudo -u test bash --noprofile --norc -euo pipefail '{0}'""""
429435 )
@@ -774,8 +780,8 @@ workflowWithCopyright(
774780// work-around for https://bugs.kali.org/view.php?id=6672
775781// and https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2069555
776782 condition= """
777- (matrix.distribution.user-id != 'kali-linux ')
778- && (matrix.distribution.user-id != 'Ubuntu-24.04 ')
783+ (matrix.distribution.user-id != '${ kali[ " user-id " ]} ')
784+ && (matrix.distribution.user-id != '${ubuntu2404[ " user-id " ]} ')
779785""" .trimIndent()
780786 )
781787 executeActionStep= usesSelf(
@@ -861,7 +867,7 @@ workflowWithCopyright(
861867 verifyInstalledDistribution(
862868 name= " Test - wsl-bash_${expr(" matrix.distributions.distribution$i .user-id" )} should use the correct distribution" ,
863869 conditionTransformer= if (distributions[i]== ubuntu2004) {
864- { executeActionStep.getSuccessNotOnDistributionCondition(i," Ubuntu-20.04 " ) }
870+ { executeActionStep.getSuccessNotOnDistributionCondition(i,ubuntu2004[ " user-id " ] !! ) }
865871 }else {
866872 { it }
867873 },
@@ -873,7 +879,7 @@ workflowWithCopyright(
873879if (distributions[i]== ubuntu2004) {
874880 verifyInstalledDistribution(
875881 name= " Test - wsl-bash_${expr(" matrix.distributions.distribution$i .user-id" )} should use the correct distribution" ,
876- conditionTransformer= { executeActionStep.getSuccessNotOnDistributionCondition(i," Ubuntu-22.04 " ) },
882+ conditionTransformer= { executeActionStep.getSuccessNotOnDistributionCondition(i,ubuntu2204[ " user-id " ] !! ) },
877883 shell= Shell .Custom (" wsl-bash_${distributions[i][" user-id" ]} {0}" ),
878884 expectedPatternExpression= " matrix.distributions.distribution$i .match-pattern"
879885 )
@@ -941,11 +947,12 @@ fun JobBuilder<*>.commonTests() {
941947
942948fun JobBuilder <* >.usesSelfAfterSuccess (
943949name : String = "Execute action",
950+ conditionTransformer : (String )-> String = { it },
944951action : SetupWsl
945952)= usesSelf(
946953 name= name,
947954 action= action,
948- condition= executeActionStep.successCondition
955+ condition= conditionTransformer( executeActionStep.successCondition).trimIndent()
949956)
950957
951958fun JobBuilder <* >.usesSelf (
@@ -1078,14 +1085,21 @@ val Step<*>.successOnAlpineCondition
10781085 get()= """
10791086 always()
10801087 && (${outcome.eq(Success )} )
1081- && (matrix.distribution.user-id == 'Alpine')
1088+ && (matrix.distribution.user-id == '${alpine[" user-id" ]} ')
1089+ """ .trimIndent()
1090+
1091+ val Step <* >.successNotOnKaliCondition
1092+ get()= """
1093+ always()
1094+ && (${outcome.eq(Success )} )
1095+ && (matrix.distribution.user-id != '${kali[" user-id" ]} ')
10821096""" .trimIndent()
10831097
10841098val Step <* >.successNotOnUbuntu2404Condition
10851099 get()= """
10861100 always()
10871101 && (${outcome.eq(Success )} )
1088- && (matrix.distribution.user-id != 'Ubuntu-24.04 ')
1102+ && (matrix.distribution.user-id != '${ubuntu2404[ " user-id " ]} ')
10891103""" .trimIndent()
10901104
10911105fun Step <* >.getSuccessNotOnDistributionCondition (i : Int ,distribution : String )= """