mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-24 05:29:26 +08:00
Added test cases for annotations and API integration
This commit is contained in:
@@ -67,8 +67,8 @@ function getLastSuccessfulRunSha(githubToken) {
|
||||
const branch = process.env.GITHUB_REF.replace("refs/heads/", "");
|
||||
const response = yield gitHubClient.getSuccessfulRunsOnBranch(branch);
|
||||
if (response.statusCode == httpClient_1.StatusCodes.OK
|
||||
&& response.body
|
||||
&& response.body.total_count) {
|
||||
&& !!response.body
|
||||
&& !!response.body.total_count) {
|
||||
if (response.body.total_count > 0) {
|
||||
lastSuccessRunSha = response.body.workflow_runs[0].head_sha;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ function getLastSuccessfulRunSha(githubToken) {
|
||||
else if (response.statusCode != httpClient_1.StatusCodes.OK) {
|
||||
core.debug(`An error occured while getting succeessful run results. Statuscode: ${response.statusCode}, StatusMessage: ${response.statusMessage}`);
|
||||
}
|
||||
return lastSuccessRunSha;
|
||||
return Promise.resolve(lastSuccessRunSha);
|
||||
});
|
||||
}
|
||||
exports.getLastSuccessfulRunSha = getLastSuccessfulRunSha;
|
||||
|
||||
Reference in New Issue
Block a user