File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { setTimeout as sleep } from 'node:timers/promises';
44import { signAddon } from 'amo-upload' ;
55import { last } from 'lodash-es' ;
66import { path as _path , getVersion } from '../config.mjs' ;
7- import { copyDir , fileExists } from '../utils.mjs' ;
7+ import { copyDir , fileExists , getNote } from '../utils.mjs' ;
88import { createZip } from '../zip.mjs' ;
99
1010let 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 ,
Original file line number Diff line number Diff 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
2830export default packCws ;
Original file line number Diff line number Diff line change 11import { createReadStream } from 'node:fs' ;
22import { EdgeAddonsAPI } from '@plasmohq/edge-addons-api' ;
3+ import { getNote } from '../utils.mjs' ;
34
45export 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}
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments