Socket
Socket
Sign inDemoInstall

@actions/tool-cache

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@actions/tool-cache - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

5

lib/tool-cache.d.ts

@@ -11,5 +11,6 @@ import * as mm from './manifest';

* @param dest path to download tool
* @param auth authorization header
* @returns path to downloaded tool
*/
export declare function downloadTool(url: string, dest?: string, token?: string): Promise<string>;
export declare function downloadTool(url: string, dest?: string, auth?: string): Promise<string>;
/**

@@ -85,3 +86,3 @@ * Extract a .7z file

export declare type IToolReleaseFile = mm.IToolReleaseFile;
export declare function getManifestFromRepo(owner: string, repo: string, token: string, branch?: string): Promise<IToolRelease[]>;
export declare function getManifestFromRepo(owner: string, repo: string, auth?: string, branch?: string): Promise<IToolRelease[]>;
export declare function findFromManifest(versionSpec: string, stable: boolean, manifest: IToolRelease[], archFilter?: string): Promise<IToolRelease | undefined>;

38

lib/tool-cache.js

@@ -51,5 +51,6 @@ "use strict";

* @param dest path to download tool
* @param auth authorization header
* @returns path to downloaded tool
*/
function downloadTool(url, dest, token) {
function downloadTool(url, dest, auth) {
return __awaiter(this, void 0, void 0, function* () {

@@ -65,3 +66,3 @@ dest = dest || path.join(_getTempDirectory(), v4_1.default());

return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
return yield downloadToolAttempt(url, dest || '', token);
return yield downloadToolAttempt(url, dest || '', auth);
}), (err) => {

@@ -82,3 +83,3 @@ if (err instanceof HTTPError && err.httpStatusCode) {

exports.downloadTool = downloadTool;
function downloadToolAttempt(url, dest, token) {
function downloadToolAttempt(url, dest, auth) {
return __awaiter(this, void 0, void 0, function* () {

@@ -93,5 +94,6 @@ if (fs.existsSync(dest)) {

let headers;
if (token) {
if (auth) {
core.debug('set auth');
headers = {
authorization: `token ${token}`
authorization: auth
};

@@ -154,5 +156,6 @@ }

try {
const logLevel = core.isDebug() ? '-bb1' : '-bb0';
const args = [
'x',
'-bb1',
logLevel,
'-bd',

@@ -240,2 +243,5 @@ '-sccUTF-8',

}
if (core.isDebug() && !flags.includes('v')) {
args.push('-v');
}
let destArg = dest;

@@ -290,3 +296,3 @@ let fileArg = file;

// run powershell
const powershellPath = yield io.which('powershell');
const powershellPath = yield io.which('powershell', true);
const args = [

@@ -307,4 +313,8 @@ '-NoLogo',

return __awaiter(this, void 0, void 0, function* () {
const unzipPath = yield io.which('unzip');
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
const unzipPath = yield io.which('unzip', true);
const args = [file];
if (!core.isDebug()) {
args.unshift('-q');
}
yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
});

@@ -437,3 +447,3 @@ }

exports.findAllVersions = findAllVersions;
function getManifestFromRepo(owner, repo, token, branch = 'master') {
function getManifestFromRepo(owner, repo, auth, branch = 'master') {
return __awaiter(this, void 0, void 0, function* () {

@@ -443,5 +453,7 @@ let releases = [];

const http = new httpm.HttpClient('tool-cache');
const headers = {
authorization: `token ${token}`
};
const headers = {};
if (auth) {
core.debug('set auth');
headers.authorization = auth;
}
const response = yield http.getJson(treeUrl, headers);

@@ -448,0 +460,0 @@ if (!response.result) {

{
"name": "@actions/tool-cache",
"version": "1.5.3",
"version": "1.5.4",
"description": "Actions tool-cache lib",

@@ -10,3 +10,3 @@ "keywords": [

],
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/tool-cache",
"license": "MIT",

@@ -40,3 +40,3 @@ "main": "lib/tool-cache.js",

"dependencies": {
"@actions/core": "^1.2.0",
"@actions/core": "^1.2.3",
"@actions/exec": "^1.0.0",

@@ -43,0 +43,0 @@ "@actions/http-client": "^1.0.8",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc