Skip to content

Commit 2619917

Browse files
committed
feat(actions): validate response when checking active deployment
1 parent 56d49f6 commit 2619917

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ const run = async () => {
3737
res = await fetch(`https://api.render.com/v1/services/${serviceId}/deploys?limit=20`, { method: 'GET', ...options });
3838
data = await res.json();
3939

40+
if (!data) {
41+
core.setFailed(`This operation did not succeed. Please check if the serviceId and apiKey inputs were correclty set`);
42+
return;
43+
}
44+
4045
if (res.status !== 200) {
4146
core.setFailed(`This operation did not succeed. Reason: ${data.message}`);
4247
return;

0 commit comments

Comments
 (0)