Skip to content

Commit c106dbe

Browse files
Add debug logs
1 parent b9fb00f commit c106dbe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const isValidVersionType = (versionType: string): boolean =>
1919

2020
// Returns the latest version of the 1Password CLI based on the specified channel.
2121
const getLatestVersion = (channel: VersionType): Promise<string> => {
22+
core.debug(`Getting ${channel} version`);
2223
const CLI_URL = "https://app-updates.agilebits.com/product_history/CLI2";
2324
return new Promise((resolve, reject) => {
2425
https
@@ -33,6 +34,7 @@ const getLatestVersion = (channel: VersionType): Promise<string> => {
3334
const versions = matches
3435
.map((match) => match[1]?.trim())
3536
.filter((ver) => {
37+
core.debug("Found version: " + ver);
3638
if (channel === VersionType.Latest) {
3739
return !ver?.includes("-beta");
3840
} else if (channel === VersionType.LatestBeta) {
@@ -46,7 +48,10 @@ const getLatestVersion = (channel: VersionType): Promise<string> => {
4648
resolve(`v${versions[0]}`);
4749
});
4850
})
49-
.on("error", reject);
51+
.on("error", (e) => {
52+
core.error(`Failed to get version of the 1Password CLI: ${e.message}`);
53+
reject();
54+
});
5055
});
5156
};
5257

0 commit comments

Comments
 (0)