Skip to content

Commit

Permalink
Change scope of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nosmo committed Jan 23, 2019
1 parent 1377d35 commit 70b512f
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ public String postBuildComment(Run<?, ?> build, TaskListener listener) {

try {
String content = null;
FilePath workspace;
FilePath path;

// On custom pipelines, build will be an instance of WorkflowRun
if (build instanceof WorkflowRun) {
FlowExecution exec = ((WorkflowRun) build).getExecution();
Expand All @@ -76,7 +73,7 @@ public String postBuildComment(Run<?, ?> build, TaskListener listener) {
continue;
}

path = action.getWorkspace().child(scriptFilePathResolved);
FilePath path = action.getWorkspace().child(scriptFilePathResolved);

if (path.exists()) {
content = path.readToString();
Expand All @@ -93,8 +90,8 @@ public String postBuildComment(Run<?, ?> build, TaskListener listener) {
}
} else if (build instanceof Build<?, ?>) {
// When using workers on hosts other than master, we simply get the workspace here.
workspace = ((Build<?, ?>) build).getWorkspace();
path = workspace.child(scriptFilePathResolved);
FilePath workspace = ((Build<?, ?>) build).getWorkspace();
FilePath path = workspace.child(scriptFilePathResolved);

if (path.exists()) {
content = path.readToString();
Expand Down

0 comments on commit 70b512f

Please sign in to comment.