Skip to content

Commit

Permalink
Merge pull request #5 from mr-smithers-excellent/fix-output
Browse files Browse the repository at this point in the history
Properly set the imageFullName output value
  • Loading branch information
mr-smithers-excellent authored Oct 21, 2019
2 parents b31992a + b5a66c6 commit a9e30d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ const run = () => {
docker.build(imageName);
docker.push(imageName);

core.setOutput(imageName);
core.setOutput('imageFullName', imageName);
} catch (error) {
core.setFailed(error.message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/docker-build-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const run = () => {
docker.build(imageName);
docker.push(imageName);

core.setOutput(imageName);
core.setOutput('imageFullName', imageName);
} catch (error) {
core.setFailed(error.message);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/docker-build-push.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ describe('Create & push Docker image', () => {
.mockReturnValueOnce(image)
.mockReturnValueOnce(registry)
.mockReturnValueOnce(null);
core.setOutput = jest.fn().mockReturnValueOnce(`${registry}/${image}:${tag}`);
core.setOutput = jest.fn().mockReturnValueOnce('imageFullName', `${registry}/${image}:${tag}`);

run();

expect(docker.createTag).toHaveBeenCalledTimes(1);
expect(core.getInput).toHaveBeenCalledTimes(3);
expect(core.setOutput).toHaveBeenCalledWith(`${registry}/${image}:${tag}`);
expect(core.setOutput).toHaveBeenCalledWith('imageFullName', `${registry}/${image}:${tag}`);
});
});

Expand Down

0 comments on commit a9e30d9

Please sign in to comment.