Skip to content

Commit 30c0609

Browse files
committed
chore: update note
1 parent 00ec657 commit 30c0609

4 files changed

Lines changed: 16 additions & 7 deletions

File tree

scripts/pack-utils/amo.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { setTimeout as sleep } from 'node:timers/promises';
44
import { signAddon } from 'amo-upload';
55
import { last } from 'lodash-es';
66
import { path as _path, getVersion } from '../config.mjs';
7-
import { copyDir, fileExists } from '../utils.mjs';
7+
import { copyDir, fileExists, getNote } from '../utils.mjs';
88
import { createZip } from '../zip.mjs';
99

1010
let packingSourceCode = null;
@@ -114,8 +114,7 @@ export async function submitAddon(
114114
const opts = {
115115
apiKey: process.env.AMO_KEY,
116116
apiSecret: process.env.AMO_SECRET,
117-
approvalNotes:
118-
'https://github.com/FirefoxBar/HeaderEditor/blob/master/README.md',
117+
approvalNotes: getNote(),
119118
override: false,
120119
pollInterval: 8000,
121120
pollRetry: 9999,

scripts/pack-utils/cws.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ async function packCws({ zipPath, extensionConfig }) {
2020
clientSecret: process.env.CWS_CLIENT_SECRET,
2121
});
2222

23-
return client.submit({
23+
const res = await client.submit({
2424
filePath: zipPath,
2525
});
26+
27+
return JSON.stringify(res);
2628
}
2729

2830
export default packCws;

scripts/pack-utils/edge.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createReadStream } from 'node:fs';
22
import { EdgeAddonsAPI } from '@plasmohq/edge-addons-api';
3+
import { getNote } from '../utils.mjs';
34

45
export default async function ({ zipPath, extensionConfig }) {
56
if (!process.env.MS_CLIENT_ID) {
@@ -19,9 +20,7 @@ export default async function ({ zipPath, extensionConfig }) {
1920
console.log('[edge] upload done', uploadResp);
2021
const uploadStatus = await client.waitForUpload(uploadResp);
2122
console.log('[edge] upload check success', uploadStatus);
22-
const publishResp = await client.publish(
23-
'https://github.com/FirefoxBar/HeaderEditor/blob/master/README.md',
24-
);
23+
const publishResp = await client.publish(getNote());
2524
console.log('[edge] publish done', publishResp);
2625
return JSON.stringify(await client.getPublishStatus(publishResp));
2726
}

scripts/utils.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,12 @@ export function copyDir(source, target) {
6666
);
6767
});
6868
}
69+
70+
export function getNote() {
71+
const repo = process.env.GITHUB_REPOSITORY;
72+
const runId = process.env.GITHUB_RUN_ID;
73+
if (repo && runId) {
74+
return `https://github.com/${repo}/actions/runs/${runId}`;
75+
}
76+
return 'https://github.com/FirefoxBar/HeaderEditor/blob/master/README.md';
77+
}

0 commit comments

Comments
 (0)