Skip to content

Commit eb41679

Browse files
Merge pull request #307 from actions/v-alsvir/disable-cache-usage-temp-v1
Temporarily disable image cache usage for v1
2 parents 56899e0 + 5f10e34 commit eb41679

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

__tests__/installer.test.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ describe('installer tests', () => {
8888
}
8989
}, 100000);
9090

91-
it('Uses version of node installed in cache', async () => {
91+
// Usage of pre-cached Node.js is temporarily disabled.
92+
xit('Uses version of node installed in cache', async () => {
9293
const nodeDir: string = path.join(toolDir, 'node', '250.0.0', os.arch());
9394
await io.mkdirP(nodeDir);
9495
fs.writeFileSync(`${nodeDir}.complete`, 'hello');
@@ -111,7 +112,8 @@ describe('installer tests', () => {
111112
return;
112113
});
113114

114-
it('Resolves semantic versions of node installed in cache', async () => {
115+
// Usage of pre-cached Node.js is temporarily disabled.
116+
xit('Resolves semantic versions of node installed in cache', async () => {
115117
const nodeDir: string = path.join(toolDir, 'node', '252.0.0', os.arch());
116118
await io.mkdirP(nodeDir);
117119
fs.writeFileSync(`${nodeDir}.complete`, 'hello');

dist/index.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -12231,7 +12231,8 @@ function getNode(versionSpec) {
1223112231
let toolPath;
1223212232
toolPath = tc.find('node', versionSpec);
1223312233
// If not found in cache, download
12234-
if (!toolPath) {
12234+
// Usage of pre-cached Node.js is temporarily disabled.
12235+
if (true) {
1223512236
let version;
1223612237
const c = semver.clean(versionSpec) || '';
1223712238
// If explicit version
@@ -12248,7 +12249,8 @@ function getNode(versionSpec) {
1224812249
// check cache
1224912250
toolPath = tc.find('node', version);
1225012251
}
12251-
if (!toolPath) {
12252+
// Usage of pre-cached Node.js is temporarily disabled.
12253+
if (true) {
1225212254
// download, extract, cache
1225312255
toolPath = yield acquireNode(version);
1225412256
}
@@ -12342,6 +12344,7 @@ function acquireNode(version) {
1234212344
let downloadUrl = `https://nodejs.org/dist/v${version}/${urlFileName}`;
1234312345
let downloadPath;
1234412346
try {
12347+
core.info(`Downloading ${downloadUrl}`);
1234512348
downloadPath = yield tc.downloadTool(downloadUrl);
1234612349
}
1234712350
catch (err) {

src/installer.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export async function getNode(versionSpec: string) {
2525
toolPath = tc.find('node', versionSpec);
2626

2727
// If not found in cache, download
28-
if (!toolPath) {
28+
// Usage of pre-cached Node.js is temporarily disabled.
29+
if (true) {
2930
let version: string;
3031
const c = semver.clean(versionSpec) || '';
3132
// If explicit version
@@ -45,7 +46,8 @@ export async function getNode(versionSpec: string) {
4546
toolPath = tc.find('node', version);
4647
}
4748

48-
if (!toolPath) {
49+
// Usage of pre-cached Node.js is temporarily disabled.
50+
if (true) {
4951
// download, extract, cache
5052
toolPath = await acquireNode(version);
5153
}
@@ -146,6 +148,7 @@ async function acquireNode(version: string): Promise<string> {
146148
let downloadPath: string;
147149

148150
try {
151+
core.info(`Downloading ${downloadUrl}`);
149152
downloadPath = await tc.downloadTool(downloadUrl);
150153
} catch (err) {
151154
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {

0 commit comments

Comments
 (0)