Skip to content

Commit cb72d40

Browse files
committed
ci: try to use microsoft update
1 parent 0e64593 commit cb72d40

File tree

3 files changed

+5
-22
lines changed

3 files changed

+5
-22
lines changed

lib/main/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/install.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os from 'node:os';
2-
import { basename, dirname, join as joinPaths } from 'node:path';
2+
import { basename, join as joinPaths } from 'node:path';
33
import { readFile } from 'node:fs/promises';
44
import * as core from '@actions/core';
55
import * as exec from '@actions/exec';
@@ -8,7 +8,6 @@ import { VersionConfig, VERSIONS } from './versions';
88
import {
99
downloadBoxInstaller,
1010
downloadExeInstaller,
11-
downloadUpdateInstaller,
1211
gatherInputs,
1312
gatherSummaryFiles,
1413
getOsVersion,
@@ -34,15 +33,6 @@ function findOrDownloadTool(config: VersionConfig): Promise<string> {
3433
return downloadExeInstaller(config);
3534
}
3635

37-
function findOrDownloadUpdates(config: VersionConfig): Promise<string> {
38-
const toolPath = tc.find('sqlupdate', config.version);
39-
if (toolPath) {
40-
core.info(`Found in cache @ ${toolPath}`);
41-
return Promise.resolve(joinPaths(toolPath, 'sqlupdate.exe'));
42-
}
43-
return downloadUpdateInstaller(config);
44-
}
45-
4636
export default async function install() {
4737
let threw = false;
4838
const {
@@ -98,14 +88,7 @@ export default async function install() {
9888
// Initial checks complete - fetch the installer
9989
const toolPath = await core.group(`Fetching install media for ${version}`, () => findOrDownloadTool(config));
10090
if (installUpdates) {
101-
if (!config.updateUrl) {
102-
core.info('Skipping update installation - version not supported');
103-
} else {
104-
const updatePath = await core.group(`Fetching cumulative updates for ${version}`, () => findOrDownloadUpdates(config));
105-
if (updatePath) {
106-
installArgs.push('/UPDATEENABLED=1', `/UpdateSource=${dirname(updatePath)}`);
107-
}
108-
}
91+
installArgs.push('/UPDATEENABLED=1', `/UpdateSource=MU`);
10992
}
11093
const instanceName = 'MSSQLSERVER';
11194
try {

test/install.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('install', () => {
163163
expect(execStub.exec).to.have.been.calledWith('"C:/tmp/exe/setup.exe"', match.array, { windowsVerbatimArguments: true });
164164
expect(execStub.exec.firstCall.args[1]).to.contain.members([
165165
'/UPDATEENABLED=1',
166-
'/UpdateSource=C:/tmp/exe',
166+
'/UpdateSource=MU',
167167
]);
168168
});
169169
it('uses cached updates if found', async () => {
@@ -183,7 +183,7 @@ describe('install', () => {
183183
expect(execStub.exec).to.have.been.calledWith('"C:/tmp/exe/setup.exe"', match.array, { windowsVerbatimArguments: true });
184184
expect(execStub.exec.firstCall.args[1]).to.contain.members([
185185
'/UPDATEENABLED=1',
186-
'/UpdateSource=C:/tool-cache/sql-update',
186+
'/UpdateSource=MU',
187187
]);
188188
});
189189
it('skips cumulative updates if no update url', async () => {

0 commit comments

Comments
 (0)