Skip to content

Commit 4926495

Browse files
committed
build 81370ec (v1.0.1)
1 parent b30245c commit 4926495

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Publish Edge Add-on
22
author: Hyperbola
3-
description: Publish addon onto Edge Add-ons
3+
description: GitHub Action for publishing extension to Microsoft Edge Add-on
44

55
inputs:
66
product-id:

index.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ async function uploadPackage(productId, zipPath, token) {
8080
}
8181
if (status === 'Succeeded') {
8282
core.info('Package validated.');
83-
return;
83+
return true;
8484
}
8585
// Validation failed.
8686
core.setFailed('Validation failed: ' + response.data.errorCode);
8787
core.setFailed(response.data.message);
8888
response.data.errors.forEach((e) => core.setFailed(JSON.stringify(e)));
89+
return false;
8990
}
9091
async function sendSubmissionRequest(productId, token) {
9192
core.info('Start to send submission request.');
@@ -102,7 +103,8 @@ async function sendSubmissionRequest(productId, token) {
102103
let status;
103104
while (true) {
104105
response = await (0, axios_1.default)(url, { headers: { Authorization: `Bearer ${token}` } });
105-
status = response.data.Status;
106+
status = response.data.status;
107+
core.debug('Status: ' + status);
106108
if (status !== 'InProgress') {
107109
break;
108110
}
@@ -176,7 +178,11 @@ async function sendSubmissionRequest(productId, token) {
176178
async function run(productId, zipPath, clientId, clientSecret, accessUrl) {
177179
core.info('Start to publish edge addon.');
178180
const token = await getAccessToken(clientId, clientSecret, accessUrl);
179-
await uploadPackage(productId, zipPath, token);
181+
const uploaded = await uploadPackage(productId, zipPath, token);
182+
if (!uploaded) {
183+
core.setFailed('Addon not published.');
184+
return;
185+
}
180186
await sendSubmissionRequest(productId, token);
181187
core.info('Addon published.');
182188
}

0 commit comments

Comments
 (0)