You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message: `### ⚠️ Cannot proceed with deployment\n\n- commit: \`${sha}\`\n- verification failed reason: \`valid\`\n\n> The commit signature is not valid as there is no valid \`verified_at\` date. Please ensure the commit has been properly signed and try again.`,
198
+
status: false,
199
+
isVerified: true
200
+
})
201
+
})
202
+
203
+
test('rejects a deployment if commit.verification.verified_at is missing and commit_verification is true',async()=>{
message: `### ⚠️ Cannot proceed with deployment\n\n- commit: \`${sha}\`\n- verification failed reason: \`valid\`\n\n> The commit signature is not valid as there is no valid \`verified_at\` date. Please ensure the commit has been properly signed and try again.`,
214
+
status: false,
215
+
isVerified: true
216
+
})
217
+
})
218
+
219
+
test('isTimestampOlder throws if timestampA is missing',()=>{
message: `### ⚠️ Cannot proceed with deployment\n\n- commit: \`${sha}\`\n- verification failed reason: \`${commit?.verification?.reason}\`\n\n> The commit signature is not valid as there is no valid \`verified_at\` date. Please ensure the commit has been properly signed and try again.`,
66
+
status: false,
67
+
isVerified: isVerified
68
+
}
69
+
}
70
+
55
71
// check to ensure that the commit signature was authored before the comment was created
56
72
// even if the commit signature is valid, we still want to reject it if it was authored after the comment was created
message: `### ⚠️ Cannot proceed with deployment\n\nThe latest commit is not safe for deployment. The commit signature was verified after the trigger comment was created. Please try again if you recently pushed a new commit.`,
@@ -77,15 +93,19 @@ export async function commitSafetyChecks(context, data) {
77
93
// :param timestampA: The first timestamp to compare (String - format: "2024-10-21T19:10:24Z")
78
94
// :param timestampB: The second timestamp to compare (String - format: "2024-10-21T19:10:24Z")
79
95
// :returns: true if timestampA is older than timestampB, false otherwise
0 commit comments