Skip to content

Commit 6060dd7

Browse files
authored
fix: skip release if is patch (#325)
1 parent f12c96c commit 6060dd7

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

config/build.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ module.exports = {
6565
applePassword: process.env.APPLE_DEV_PASSWORD,
6666
appleAppIdentity: process.env.APPLE_APP_IDENTITY,
6767
isCi: process.env.IS_CI === 'true',
68+
isPatch: process.env.IS_PATCH === 'true',
6869
platform: os.platform(),
6970
buildVariant: process.env.BUILD_VARIANT,
7071
repo: {

packages/build/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ export default interface Config {
2929
repo: string;
3030
};
3131
dryRun?: boolean;
32+
isPatch?: boolean;
3233
}

packages/build/src/github-repo.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ describe('GithubRepo', () => {
2727
});
2828

2929
describe('shouldDoPublicRelease', () => {
30+
it('returns false when isPatch is true', async() => {
31+
const config = { isPatch: true };
32+
expect(await githubRepo.shouldDoPublicRelease(config)).to.be.false;
33+
});
34+
35+
3036
it('returns false when branch is not master', async() => {
3137
const config = { branch: 'feature' };
3238
expect(await githubRepo.shouldDoPublicRelease(config)).to.be.false;

packages/build/src/github-repo.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ export class GithubRepo {
162162
* current version matches current revision.
163163
*/
164164
async shouldDoPublicRelease(config: Config): Promise<boolean> {
165+
if (config.isPatch) {
166+
console.info('mongosh: skip public release: is a patch');
167+
return false;
168+
}
169+
165170
if (config.branch !== 'master') {
166171
console.info('mongosh: skip public release: is not master');
167172
return false;

packages/build/src/redact-config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export function redactConfig(config: Config): any {
1414
branch: config.branch,
1515
isCi: config.isCi,
1616
platform: config.platform,
17-
repo: config.repo
17+
repo: config.repo,
18+
isPatch: config.isPatch
1819
};
1920
}

0 commit comments

Comments
 (0)