Skip to content

Commit 9811946

Browse files
authored
fix(build): "package" task fails on feature-branches #3818
Problem: The "Package Test" CI job fails on `feature/x` branches that set `betaUrl`: Error: Cannot package VSIX as both a release and a beta simultaneously at main (/codebuild/output/src3161342786/src/github.com/aws/aws-toolkit-vscode-staging/scripts/build/package.ts:111:19) (Note: `feature/x` branches are auto-tagged as `pre-x`, e.g. https://github.com/aws/aws-toolkit-vscode/releases/tag/pre-ec2 ) Solution: Make isRelease() more precise.
1 parent c0e1563 commit 9811946

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/build/package.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ function parseArgs() {
6868
}
6969

7070
/**
71-
* If the current commit is tagged then it is a "release build", else it is
72-
* a prerelease/nightly/edge/preview build.
71+
* If the _current_ commit is tagged as a release ("v1.26.0") then it is a "release build", else it
72+
* is a prerelease/nightly/edge/preview build.
7373
*/
7474
function isRelease(): boolean {
75-
return child_process.execSync('git tag -l --contains HEAD').toString() !== ''
75+
const tag = child_process.execSync('git tag -l --contains HEAD').toString()
76+
return !!tag?.match(/v\d+\.\d+\.\d+/)
7677
}
7778

7879
/**

0 commit comments

Comments
 (0)