Skip to content

Commit

Permalink
fix: Only parse amo-upload-uuid for v5 signing
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Sep 10, 2024
1 parent 15a187c commit fe10add
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "action-web-ext",
"version": "1.1.0",
"version": "1.3.0",
"description": "Run a web-ext command",
"type": "module",
"repository": {
Expand Down
14 changes: 7 additions & 7 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export default class WebExtAction {
}

let result;
let uploadUuid;
try {
if (this.options.apiUrlPrefix.includes("v5")) {
result = await signAddonV5({
Expand All @@ -205,6 +206,12 @@ export default class WebExtAction {
submissionSource: this.options.sourceCode,
userAgentString: "kewisch/action-web-ext",
});

try {
uploadUuid = JSON.parse(await fs.promises.readFile(path.join(tmpdir, ".amo-upload-uuid"), { encoding: "utf-8" }));
} catch (e) {
console.warn("Could not parse amo-upload-uuid file:", e);
}
} else if (this.options.apiUrlPrefix.includes("v4")) {
if (this.options.approvalNotes) {
throw new Error("Approval notes cannot be submitted in API v4");
Expand Down Expand Up @@ -250,13 +257,6 @@ export default class WebExtAction {
}
}

let uploadUuid;
try {
uploadUuid = JSON.parse(await fs.promises.readFile(path.join(tmpdir, ".amo-upload-uuid"), { encoding: "utf-8" }));
} catch (e) {
console.warn("Could not parse amo-upload-uuid file:", e);
}

if (result.downloadedFiles) {
console.log("Downloaded these files: " + result.downloadedFiles);
return {
Expand Down

0 comments on commit fe10add

Please sign in to comment.