-
Notifications
You must be signed in to change notification settings - Fork 9
Add Chrome Web Store upload functionality #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
@copilot Try again |
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
| const filesToZip = includePaths.join(' '); | ||
|
|
||
| try { | ||
| execSync(`zip -r ${zipFilePath} ${filesToZip}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values Medium
absolute path
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
To fix the problem, the construction and execution of the zip command must avoid interpolating potentially unsafe paths into a shell string. Instead, use execFileSync to run the zip command, passing each argument as an element in an array. This prevents the shell from interpreting spaces or special characters. Specifically, replace the execSync call on line 48 with an execFileSync call, where the command is 'zip', and the arguments are ['-r', zipFilePath, ...includePaths]. Also, ensure that the working directory stays the same and output is inherited. No functional change outside this call is needed. Only the region on lines 48 in build.js requires modification.
-
Copy modified lines R48-R52
| @@ -45,10 +45,11 @@ | ||
| const filesToZip = includePaths.join(' '); | ||
|
|
||
| try { | ||
| execSync(`zip -r ${zipFilePath} ${filesToZip}`, { | ||
| cwd: __dirname, | ||
| stdio: 'inherit' | ||
| }); | ||
| require('child_process').execFileSync( | ||
| 'zip', | ||
| ['-r', zipFilePath, ...includePaths], | ||
| { cwd: __dirname, stdio: 'inherit' } | ||
| ); | ||
| console.log(`\nExtension packaged successfully: ${zipFilePath}`); | ||
|
|
||
| // Get file size |
Implemented Chrome Web Store upload functionality in commit 37c5d04. The implementation includes:
To test: Run To publish: Push a new tag (e.g., |
Implements automated and manual Chrome Web Store upload functionality for the BLT Extension.
Changes Made
build.jsthat packages the extension intodist/extension.zipwith all necessary filespackage.json(was incorrectly mixing manifest.json properties) and added proper build scripts.github/workflows/release.yamlto automatically build and upload to Chrome Web Store when tags are pushedHow It Works
Automatic Publishing:
git tag v1.4.1 && git push origin v1.4.1Manual Publishing:
npm run buildto create the extension packagedist/extension.zipto the Chrome Web Store Developer DashboardTesting
The extension is now ready for Chrome Web Store publication.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.