Skip to content

Commit b6f19a4

Browse files
committed
lint
1 parent 3e0375c commit b6f19a4

3 files changed

Lines changed: 7 additions & 28 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { run } from './main';
22

3-
void run();
3+
run();

actions/release-tag-creation/main.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('validateFormat', () => {
7272
['5.20.0-beta3'],
7373
['10.0.0-beta10'],
7474
])('accepts valid version %s', (version) => {
75-
expect(() => validateFormat(version)).not.toThrow();
75+
expect(() => { validateFormat(version); }).not.toThrow();
7676
});
7777

7878
it.each([
@@ -84,7 +84,7 @@ describe('validateFormat', () => {
8484
['not-a-version'],
8585
[''],
8686
])('rejects invalid version %s', (version) => {
87-
expect(() => validateFormat(version)).toThrow('not in the correct format');
87+
expect(() => { validateFormat(version); }).toThrow('not in the correct format');
8888
});
8989
});
9090

@@ -97,21 +97,21 @@ describe('checkTagDoesNotExist', () => {
9797

9898
it('does not throw when ls-remote returns empty (tag absent)', () => {
9999
mockExecSync.mockReturnValue('' as never);
100-
expect(() => checkTagDoesNotExist('3.11.0')).not.toThrow();
100+
expect(() => { checkTagDoesNotExist('3.11.0'); }).not.toThrow();
101101
});
102102

103103
it('throws when ls-remote returns a line (tag exists)', () => {
104104
mockExecSync.mockReturnValue(
105105
'abc123\trefs/tags/3.11.0\n' as never,
106106
);
107-
expect(() => checkTagDoesNotExist('3.11.0')).toThrow('already exists');
107+
expect(() => { checkTagDoesNotExist('3.11.0'); }).toThrow('already exists');
108108
});
109109

110110
it('throws when execSync itself fails', () => {
111111
mockExecSync.mockImplementation(() => {
112112
throw new Error('git: not found');
113113
});
114-
expect(() => checkTagDoesNotExist('3.11.0')).toThrow('Failed to check remote tags');
114+
expect(() => { checkTagDoesNotExist('3.11.0'); }).toThrow('Failed to check remote tags');
115115
});
116116

117117
it('queries the exact ref for the given version', () => {

actions/release-tag-creation/main.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,6 @@ export function validateFormat(version: string): void {
4040
console.log(`✅ Version format is valid: ${version}`);
4141
}
4242

43-
export function checkTagDoesNotExist(version: string): void {
44-
const tagRef = `refs/tags/${version}`;
45-
let output: string;
46-
47-
try {
48-
output = execSync(`git ls-remote origin "${tagRef}"`, { encoding: 'utf8' });
49-
} catch (err) {
50-
throw new Error(`Failed to check remote tags: ${(err as Error).message}`);
51-
}
52-
53-
if (output.trim() !== '') {
54-
throw new Error(
55-
`Version ${version} already exists as a GitHub Release (tag ${version} found).`,
56-
);
57-
}
58-
59-
console.log(`✅ Version ${version} does not exist as a GitHub Release.`);
60-
}
61-
62-
6343
// ─── derivation ───────────────────────────────────────────────────────────────
6444

6545
export function extractChannel(version: string): 'stable' | 'beta' {
@@ -90,7 +70,7 @@ export function deriveBranch(version: string): string {
9070

9171
const paddedMinor = String(parsed.minor).padStart(2, '0');
9272

93-
return `${parsed.major}.${paddedMinor}`;
73+
return `${String(parsed.major)}.${paddedMinor}`;
9474
}
9575

9676
// ─── entry point ──────────────────────────────────────────────────────────────
@@ -100,7 +80,6 @@ export function run(): void {
10080
const version = getVersion();
10181

10282
validateFormat(version);
103-
checkTagDoesNotExist(version);
10483

10584
const channel = extractChannel(version);
10685
console.log(`✅ Channel resolved to: ${channel}`);

0 commit comments

Comments
 (0)