fix: missing workflow timestamp (#3445)
This commit is contained in:
parent
872e945c47
commit
9616cdb8bb
@ -56,6 +56,7 @@ type BitBucketPullRequest = {
|
|||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
state: BitBucketPullRequestState;
|
state: BitBucketPullRequestState;
|
||||||
|
updated_on: string;
|
||||||
summary: {
|
summary: {
|
||||||
raw: string;
|
raw: string;
|
||||||
};
|
};
|
||||||
@ -561,7 +562,8 @@ export default class API {
|
|||||||
);
|
);
|
||||||
const label = await this.getPullRequestLabel(pullRequest.id);
|
const label = await this.getPullRequestLabel(pullRequest.id);
|
||||||
const status = labelToStatus(label);
|
const status = labelToStatus(label);
|
||||||
return { branch, collection, slug, path, status, newFile, mediaFiles };
|
const timeStamp = pullRequest.updated_on;
|
||||||
|
return { branch, collection, slug, path, status, newFile, mediaFiles, timeStamp };
|
||||||
}
|
}
|
||||||
|
|
||||||
async readUnpublishedBranchFile(contentKey: string) {
|
async readUnpublishedBranchFile(contentKey: string) {
|
||||||
@ -573,13 +575,14 @@ export default class API {
|
|||||||
status,
|
status,
|
||||||
newFile,
|
newFile,
|
||||||
mediaFiles,
|
mediaFiles,
|
||||||
|
timeStamp,
|
||||||
} = await this.retrieveMetadata(contentKey);
|
} = await this.retrieveMetadata(contentKey);
|
||||||
|
|
||||||
const fileData = (await this.readFile(path, null, { branch })) as string;
|
const fileData = (await this.readFile(path, null, { branch })) as string;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
slug,
|
slug,
|
||||||
metaData: { branch, collection, objects: { entry: { path, mediaFiles } }, status },
|
metaData: { branch, collection, objects: { entry: { path, mediaFiles } }, status, timeStamp },
|
||||||
fileData,
|
fileData,
|
||||||
isModification: !newFile,
|
isModification: !newFile,
|
||||||
};
|
};
|
||||||
|
@ -539,7 +539,8 @@ export default class API {
|
|||||||
}));
|
}));
|
||||||
const label = pullRequest.labels.find(l => isCMSLabel(l.name)) as { name: string };
|
const label = pullRequest.labels.find(l => isCMSLabel(l.name)) as { name: string };
|
||||||
const status = labelToStatus(label.name);
|
const status = labelToStatus(label.name);
|
||||||
return { branch, collection, slug, path, status, newFile, mediaFiles, pullRequest };
|
const timeStamp = pullRequest.updated_at;
|
||||||
|
return { branch, collection, slug, path, status, newFile, mediaFiles, timeStamp, pullRequest };
|
||||||
}
|
}
|
||||||
|
|
||||||
async readFile(
|
async readFile(
|
||||||
@ -628,6 +629,7 @@ export default class API {
|
|||||||
status,
|
status,
|
||||||
newFile,
|
newFile,
|
||||||
mediaFiles,
|
mediaFiles,
|
||||||
|
timeStamp,
|
||||||
} = await this.retrieveMetadata(contentKey);
|
} = await this.retrieveMetadata(contentKey);
|
||||||
|
|
||||||
const repoURL = this.useOpenAuthoring
|
const repoURL = this.useOpenAuthoring
|
||||||
@ -641,7 +643,13 @@ export default class API {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
slug,
|
slug,
|
||||||
metaData: { branch, collection, objects: { entry: { path, mediaFiles } }, status },
|
metaData: {
|
||||||
|
branch,
|
||||||
|
collection,
|
||||||
|
objects: { entry: { path, mediaFiles } },
|
||||||
|
status,
|
||||||
|
timeStamp,
|
||||||
|
},
|
||||||
fileData,
|
fileData,
|
||||||
isModification: !newFile,
|
isModification: !newFile,
|
||||||
};
|
};
|
||||||
|
@ -562,7 +562,8 @@ export default class API {
|
|||||||
);
|
);
|
||||||
const label = mergeRequest.labels.find(isCMSLabel) as string;
|
const label = mergeRequest.labels.find(isCMSLabel) as string;
|
||||||
const status = labelToStatus(label);
|
const status = labelToStatus(label);
|
||||||
return { branch, collection, slug, path, status, newFile, mediaFiles };
|
const timeStamp = mergeRequest.updated_at;
|
||||||
|
return { branch, collection, slug, path, status, newFile, mediaFiles, timeStamp };
|
||||||
}
|
}
|
||||||
|
|
||||||
async readUnpublishedBranchFile(contentKey: string) {
|
async readUnpublishedBranchFile(contentKey: string) {
|
||||||
@ -574,13 +575,14 @@ export default class API {
|
|||||||
status,
|
status,
|
||||||
newFile,
|
newFile,
|
||||||
mediaFiles,
|
mediaFiles,
|
||||||
|
timeStamp,
|
||||||
} = await this.retrieveMetadata(contentKey);
|
} = await this.retrieveMetadata(contentKey);
|
||||||
|
|
||||||
const fileData = (await this.readFile(path, null, { branch })) as string;
|
const fileData = (await this.readFile(path, null, { branch })) as string;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
slug,
|
slug,
|
||||||
metaData: { branch, collection, objects: { entry: { path, mediaFiles } }, status },
|
metaData: { branch, collection, objects: { entry: { path, mediaFiles } }, status, timeStamp },
|
||||||
fileData,
|
fileData,
|
||||||
isModification: !newFile,
|
isModification: !newFile,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user