Skip to content

Commit 8463c3a

Browse files
chore(deps): bump snakeyaml from 1.30 to 2.0 (#39)
* chore(deps): bump snakeyaml from 1.30 to 2.0 Bumps [snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) from 1.30 to 2.0. - [Commits](https://bitbucket.org/snakeyaml/snakeyaml/branches/compare/snakeyaml-2.0..snakeyaml-1.30) --- updated-dependencies: - dependency-name: org.yaml:snakeyaml dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Fix to allow both snakeyaml 1.33 and 2.0 to work properly --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ys Liu <[email protected]>
1 parent 32cae36 commit 8463c3a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<dependency>
7474
<groupId>org.yaml</groupId>
7575
<artifactId>snakeyaml</artifactId>
76-
<version>1.30</version>
76+
<version>2.0</version>
7777
</dependency>
7878
<dependency>
7979
<groupId>org.projectlombok</groupId>

src/main/java/cn/opsbox/jenkinsci/plugins/cps/AttributeInjector.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
1414
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
1515
import org.yaml.snakeyaml.Yaml;
16+
import org.yaml.snakeyaml.LoaderOptions;
1617
import org.yaml.snakeyaml.constructor.SafeConstructor;
1718

1819
import java.io.IOException;
@@ -60,7 +61,8 @@ public void configureShell(@CheckForNull CpsFlowExecution context, GroovyShell s
6061
TaskListener taskListener = context.getOwner().getListener();
6162
String expandParameters = build.getEnvironment(taskListener).expand(parameters);
6263
if (!expandParameters.isEmpty()) {
63-
attributes = new Yaml(new SafeConstructor()).load(expandParameters);
64+
LoaderOptions loaderOptions = new LoaderOptions();
65+
attributes = new Yaml(new SafeConstructor(loaderOptions)).load(expandParameters);
6466
}
6567
}
6668

0 commit comments

Comments
 (0)