Skip to content

Commit 5dfa300

Browse files
Fix version extraction to handle non-prefixed tags
1 parent 0a3d534 commit 5dfa300

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/scripts/update-manifest.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ if (!tag) {
88
process.exit(1);
99
}
1010

11-
// The version is the tag name without the 'v' prefix
12-
const version = tag.substring(1);
11+
const version = tag.startsWith('v') ? tag.substring(1) : tag;
12+
13+
if (!/^\d+\.\d+\.\d+(-[\w.-]+)?$/.test(version)) {
14+
console.error(`Invalid version format: "${version}". Expected semver like v1.2.3 or v1.2.3-beta.1`);
15+
process.exit(1);
16+
}
1317

1418
// Path to the manifest file
1519
const manifestPath = path.resolve(__dirname, '../../frontend/manifest.json');
@@ -23,4 +27,4 @@ try {
2327
} catch (error) {
2428
console.error(`Error updating manifest file: ${error.message}`);
2529
process.exit(1);
26-
}
30+
}

0 commit comments

Comments
 (0)