From b529540e0c31b8bb9be3034241f086f6c425bdfa Mon Sep 17 00:00:00 2001 From: Jonathan Leitschuh Date: Mon, 9 Sep 2019 09:39:43 -0400 Subject: [PATCH] Don't recommend the use of HTTP to download code (#120) --- packages/tool-cache/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/tool-cache/README.md b/packages/tool-cache/README.md index 92ec54af..e00bb4b0 100644 --- a/packages/tool-cache/README.md +++ b/packages/tool-cache/README.md @@ -11,7 +11,7 @@ You can use this to download tools (or other files) from a download URL: ```js const tc = require('@actions/tool-cache'); -const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); +const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); ``` #### Extract @@ -22,15 +22,15 @@ These can then be extracted in platform specific ways: const tc = require('@actions/tool-cache'); if (process.platform === 'win32') { - const node12Path = tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip'); + const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip'); const node12ExtractedFolder = await tc.extractZip(node12Path, 'path/to/extract/to'); // Or alternately - const node12Path = tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z'); + const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z'); const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to'); } else { - const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); + const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to'); } ``` @@ -45,7 +45,7 @@ You'll often want to add it to the path as part of this step: const tc = require('@actions/tool-cache'); const core = require('@actions/core'); -const node12Path = await tc.downloadTool('http://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); +const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to'); const cachedPath = await tc.cacheDir(node12ExtractedFolder, 'node', '12.7.0');