Merge pull request #1179 from balena-io/1178-filter-before-patching-release-status

Ensure not marking successful releases as canceled
This commit is contained in:
Thodoris Greasidis 2019-04-22 20:23:13 +03:00 committed by GitHub
commit 65ac35a93e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,6 +204,11 @@ async function cancelBuildIfNecessary(build: RemoteBuild): Promise<void> {
await build.sdk.pine.patch({
resource: 'release',
id: build.releaseId,
options: {
$filter: {
status: { $ne: 'success' },
},
},
body: {
status: 'cancelled',
end_timestamp: Date.now(),