You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,14 +25,14 @@ public class ConditionalApplyPlugin implements TerraformEnvironmentStagePlugin {
20
25
if (shouldApply()) {
21
26
closure()
22
27
} else {
23
-
echo "This stage can only be run on the '${branch}' branch, but this pipeline is currently running on branch '${Jenkinsfile.instance.getEnv().BRANCH_NAME}'. Skipping stage."
28
+
echo "This stage can only be run on the '${branches}' branches, but this pipeline is currently running on branch '${Jenkinsfile.instance.getEnv().BRANCH_NAME}'. Skipping stage."
24
29
}
25
30
}
26
31
}
27
32
28
33
publicbooleanshouldApply() {
29
-
if (branch ==Jenkinsfile.instance.getEnv().BRANCH_NAME) {
30
-
println("Current branch '${Jenkinsfile.instance.getEnv().BRANCH_NAME}' matches expected branch '${branch}', stage branch-condition is met and will run.")
34
+
if (branches.contains(Jenkinsfile.instance.getEnv().BRANCH_NAME)) {
35
+
println("Current branch '${Jenkinsfile.instance.getEnv().BRANCH_NAME}' matches expected branches '${branches}', stage branch-condition is met and will run.")
println("Current branch is null - you're probably using a single-branch job which doesn't make your branch name available. Assume that apply should be enabled.")
0 commit comments