[ci] Fix state check for purge cloud deployments (#124985)

Pull request state from GitHub returns 'OPEN' if a pull request is open.
This updates the capitalization when branching from state
This commit is contained in:
Jonathan Budzenski 2022-02-08 10:31:28 -06:00 committed by GitHub
parent e7ab1e51c7
commit 9a63bb8130
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ for (const deployment of prDeployments) {
const lastCommit = pullRequest.commits.slice(-1)[0];
const lastCommitTimestamp = new Date(lastCommit.committedDate).getTime() / 1000;
if (pullRequest.state !== 'open') {
if (pullRequest.state !== 'OPEN') {
console.log(`Pull Request #${prNumber} is no longer open, will delete associated deployment`);
deploymentsToPurge.push(deployment);
} else if (!pullRequest.labels.filter((label) => label.name === 'ci:deploy-cloud')) {