Skip to content

Commit

Permalink
SLVSCODE-870 Use return value of ovsx.publish to make deployment fail…
Browse files Browse the repository at this point in the history
…ures visible
  • Loading branch information
jblievremont committed Oct 1, 2024
1 parent cc8accb commit ab7d7ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/actions/ovsx-publish/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const {
OPENVSX_TOKEN
} = process.env;

console.log(`Publishing ${ARTIFACT_FILE} to OpenVSX`);

(async () => {
/**
* @type ovsx.PublishOptions
Expand All @@ -29,10 +31,13 @@ const {
extensionFile: ARTIFACT_FILE,
pat: OPENVSX_TOKEN
};
await ovsx.publish(options);

const [ publicationResult ] = await ovsx.publish(options);
if (publicationResult.status === 'rejected') {
throw new Error(`Impossible to publish ${ARTIFACT_FILE} to OpenVSX`, { cause: publicationResult.reason });
}
})()
.then(() => {
console.log(`Published ${ARTIFACT_FILE} to OpenVSX`);
process.exit(0);
})
.catch(e => {
Expand Down

0 comments on commit ab7d7ca

Please sign in to comment.