Skip to content

Conversation

gingerbenw
Copy link
Member

Goal

Design

Changeset

Testing

Copy link

github-actions bot commented Jun 19, 2025

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 47.11 kB 14.09 kB
After 47.11 kB 14.09 kB
± No change No change

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against e5653df

for (const pkg of packages) {
// move the tarball to the fixture directory
const tarballName = `bugsnag-${pkg}-*.tgz`
const tarballFiles = fs.readdirSync(packagesDir).filter(file => file.match(new RegExp(tarballName.replace('*', '.*'))))

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of '*'.

Copilot Autofix

AI 4 months ago

To fix the issue, we need to ensure that all occurrences of * in tarballName are replaced with .*. This can be achieved by using a regular expression with the global flag (g) in the replace method. This change ensures that the resulting regular expression correctly matches files even if tarballName contains multiple * characters.

The specific change involves replacing tarballName.replace('*', '.*') with tarballName.replace(/\*/g, '.*'). This uses a regular expression to match all * characters globally and replaces them with .*.


Suggested changeset 1
scripts/generate-react-native-fixture.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/generate-react-native-fixture.js b/scripts/generate-react-native-fixture.js
--- a/scripts/generate-react-native-fixture.js
+++ b/scripts/generate-react-native-fixture.js
@@ -117,3 +117,3 @@
     const tarballName = `bugsnag-${pkg}-*.tgz`
-    const tarballFiles = fs.readdirSync(packagesDir).filter(file => file.match(new RegExp(tarballName.replace('*', '.*'))))
+    const tarballFiles = fs.readdirSync(packagesDir).filter(file => file.match(new RegExp(tarballName.replace(/\*/g, '.*'))))
     if (tarballFiles.length === 0) {
EOF
@@ -117,3 +117,3 @@
const tarballName = `bugsnag-${pkg}-*.tgz`
const tarballFiles = fs.readdirSync(packagesDir).filter(file => file.match(new RegExp(tarballName.replace('*', '.*'))))
const tarballFiles = fs.readdirSync(packagesDir).filter(file => file.match(new RegExp(tarballName.replace(/\*/g, '.*'))))
if (tarballFiles.length === 0) {
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant