Skip to content

Commit da83fa1

Browse files
committed
Update CHANGELOG
1 parent 31c352d commit da83fa1

File tree

4 files changed

+2077
-1539
lines changed

4 files changed

+2077
-1539
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
## Version History
1212

13+
### v9.8.0
14+
15+
- :tada: Update CFN-Config to latest version which supports regions created after 2022
16+
1317
### v9.7.0
1418

1519
- :tada: Add `ora` for watching for external artifacts

lib/gh.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fs from 'fs';
2+
import ora from 'ora';
23
import Git from './git.js';
34

45
/**
@@ -35,9 +36,15 @@ export default class GH {
3536
* @param {boolean} success Was the deployment successful
3637
*/
3738
async deployment(stack, success) {
38-
if (success === undefined) success = 'pending';
39-
else if (success) success = 'success';
40-
else if (!success) success = 'failed';
39+
if (success === undefined) {
40+
success = 'pending';
41+
} else if (success) {
42+
success = 'success';
43+
} else if (!success) {
44+
success = 'failed';
45+
}
46+
47+
await this.status();
4148

4249
if (this.context.deployment) {
4350
return await this.deployment_update(stack, success);
@@ -54,6 +61,24 @@ export default class GH {
5461
}
5562
}
5663

64+
async status() {
65+
const res = await fetch(this.url + `/repos/${this.context.owner}/${this.repo}/commits/${this.context.sha}/status`, {
66+
method: 'GET',
67+
headers: this.headers,
68+
});
69+
70+
const body = await res.json();
71+
72+
if (!res.ok) {
73+
console.error(body);
74+
throw new Error('Could not list status checks');
75+
} else {
76+
if (body.state === 'pending') {
77+
78+
}
79+
}
80+
}
81+
5782
async deployment_list(stack) {
5883
const url = new URL(this.url + `/repos/${this.context.owner}/${this.repo}/deployments`);
5984
url.searchParams.append('sha', this.context.sha);

0 commit comments

Comments
 (0)