Skip to content

Commit e6584d7

Browse files
Tushar JamdadeTushar Jamdade
authored andcommitted
fix(ui): avoid duplicate RUN in build history
Signed-off-by: Tushar Jamdade <[email protected]>
1 parent cd46a58 commit e6584d7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/portal/src/app/base/project/repository/artifact/artifact-additions/build-history/build-history.component.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ export class BuildHistoryComponent implements OnInit {
5353
const history: ArtifactBuildHistory =
5454
new ArtifactBuildHistory();
5555
history.created = ele.created;
56-
if (ele.created_by !== undefined) {
57-
history.created_by = ele.created_by
56+
if (ele.created_by !== undefined) {
57+
let createdBy = ele.created_by
5858
.replace('/bin/sh -c #(nop)', '')
59-
.trimLeft()
60-
.replace('/bin/sh -c', 'RUN');
59+
.trimLeft();
60+
if (!createdBy.startsWith('RUN ')) {
61+
createdBy = createdBy.replace('/bin/sh -c', 'RUN');
62+
}
63+
history.created_by = createdBy.replace(/\s+# buildkit$/, '');
6164
} else {
6265
history.created_by = ele.comment;
6366
}

0 commit comments

Comments
 (0)