Compare commits
	
		
			1 Commits
		
	
	
		
			v3.1.0
			...
			tiwarishub
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 600cfee239 | 
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@ -139,7 +139,6 @@ describe('findPackageForDownload', () => {
 | 
			
		||||
      packageType: 'jdk',
 | 
			
		||||
      checkLatest: false
 | 
			
		||||
    });
 | 
			
		||||
    distribution['getAvailableVersions'] = async () => manifestData;
 | 
			
		||||
    await expect(
 | 
			
		||||
      distribution['findPackageForDownload'](distribution['version'])
 | 
			
		||||
    ).rejects.toThrowError(/Could not find satisfied version for semver */);
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,4 @@
 | 
			
		||||
import * as cache from '@actions/cache';
 | 
			
		||||
import * as core from '@actions/core';
 | 
			
		||||
import { isVersionSatisfies, isCacheFeatureAvailable } from '../src/util';
 | 
			
		||||
 | 
			
		||||
jest.mock('@actions/cache');
 | 
			
		||||
jest.mock('@actions/core');
 | 
			
		||||
import { isVersionSatisfies } from '../src/util';
 | 
			
		||||
 | 
			
		||||
describe('isVersionSatisfies', () => {
 | 
			
		||||
  it.each([
 | 
			
		||||
@ -25,38 +20,3 @@ describe('isVersionSatisfies', () => {
 | 
			
		||||
    expect(actual).toBe(expected);
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
describe('isCacheFeatureAvailable', () => {
 | 
			
		||||
  it('isCacheFeatureAvailable disabled on GHES', () => {
 | 
			
		||||
    jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
 | 
			
		||||
    try {
 | 
			
		||||
      process.env['GITHUB_SERVER_URL'] = 'http://example.com';
 | 
			
		||||
      isCacheFeatureAvailable();
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
      expect(error).toHaveProperty(
 | 
			
		||||
        'message',
 | 
			
		||||
        'Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not.'
 | 
			
		||||
      );
 | 
			
		||||
    } finally {
 | 
			
		||||
      delete process.env['GITHUB_SERVER_URL'];
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('isCacheFeatureAvailable disabled on dotcom', () => {
 | 
			
		||||
    jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
 | 
			
		||||
    const infoMock = jest.spyOn(core, 'warning');
 | 
			
		||||
    const message = 'The runner was not able to contact the cache service. Caching will be skipped';
 | 
			
		||||
    try {
 | 
			
		||||
      process.env['GITHUB_SERVER_URL'] = 'http://github.com';
 | 
			
		||||
      expect(isCacheFeatureAvailable()).toBe(false);
 | 
			
		||||
      expect(infoMock).toHaveBeenCalledWith(message);
 | 
			
		||||
    } finally {
 | 
			
		||||
      delete process.env['GITHUB_SERVER_URL'];
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('isCacheFeatureAvailable is enabled', () => {
 | 
			
		||||
    jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => true);
 | 
			
		||||
    expect(isCacheFeatureAvailable()).toBe(true);
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										136
									
								
								dist/cleanup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										136
									
								
								dist/cleanup/index.js
									
									
									
									
										vendored
									
									
								
							@ -3730,7 +3730,10 @@ const options_1 = __webpack_require__(538);
 | 
			
		||||
const requestUtils_1 = __webpack_require__(899);
 | 
			
		||||
const versionSalt = '1.0';
 | 
			
		||||
function getCacheApiUrl(resource) {
 | 
			
		||||
    const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
 | 
			
		||||
    // Ideally we just use ACTIONS_CACHE_URL
 | 
			
		||||
    const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
 | 
			
		||||
        process.env['ACTIONS_RUNTIME_URL'] ||
 | 
			
		||||
        '').replace('pipelines', 'artifactcache');
 | 
			
		||||
    if (!baseUrl) {
 | 
			
		||||
        throw new Error('Cache Service Url not found, unable to restore cache.');
 | 
			
		||||
    }
 | 
			
		||||
@ -5929,35 +5932,7 @@ module.exports = {
 | 
			
		||||
/* 193 */,
 | 
			
		||||
/* 194 */,
 | 
			
		||||
/* 195 */,
 | 
			
		||||
/* 196 */
 | 
			
		||||
/***/ (function(__unusedmodule, exports) {
 | 
			
		||||
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
			
		||||
exports.STATE_GPG_PRIVATE_KEY_FINGERPRINT = exports.INPUT_JOB_STATUS = exports.INPUT_CACHE = exports.INPUT_DEFAULT_GPG_PASSPHRASE = exports.INPUT_DEFAULT_GPG_PRIVATE_KEY = exports.INPUT_GPG_PASSPHRASE = exports.INPUT_GPG_PRIVATE_KEY = exports.INPUT_OVERWRITE_SETTINGS = exports.INPUT_SETTINGS_PATH = exports.INPUT_SERVER_PASSWORD = exports.INPUT_SERVER_USERNAME = exports.INPUT_SERVER_ID = exports.INPUT_CHECK_LATEST = exports.INPUT_JDK_FILE = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_ARCHITECTURE = exports.INPUT_JAVA_VERSION = exports.MACOS_JAVA_CONTENT_POSTFIX = void 0;
 | 
			
		||||
exports.MACOS_JAVA_CONTENT_POSTFIX = 'Contents/Home';
 | 
			
		||||
exports.INPUT_JAVA_VERSION = 'java-version';
 | 
			
		||||
exports.INPUT_ARCHITECTURE = 'architecture';
 | 
			
		||||
exports.INPUT_JAVA_PACKAGE = 'java-package';
 | 
			
		||||
exports.INPUT_DISTRIBUTION = 'distribution';
 | 
			
		||||
exports.INPUT_JDK_FILE = 'jdkFile';
 | 
			
		||||
exports.INPUT_CHECK_LATEST = 'check-latest';
 | 
			
		||||
exports.INPUT_SERVER_ID = 'server-id';
 | 
			
		||||
exports.INPUT_SERVER_USERNAME = 'server-username';
 | 
			
		||||
exports.INPUT_SERVER_PASSWORD = 'server-password';
 | 
			
		||||
exports.INPUT_SETTINGS_PATH = 'settings-path';
 | 
			
		||||
exports.INPUT_OVERWRITE_SETTINGS = 'overwrite-settings';
 | 
			
		||||
exports.INPUT_GPG_PRIVATE_KEY = 'gpg-private-key';
 | 
			
		||||
exports.INPUT_GPG_PASSPHRASE = 'gpg-passphrase';
 | 
			
		||||
exports.INPUT_DEFAULT_GPG_PRIVATE_KEY = undefined;
 | 
			
		||||
exports.INPUT_DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE';
 | 
			
		||||
exports.INPUT_CACHE = 'cache';
 | 
			
		||||
exports.INPUT_JOB_STATUS = 'job-status';
 | 
			
		||||
exports.STATE_GPG_PRIVATE_KEY_FINGERPRINT = 'gpg-private-key-fingerprint';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
/* 196 */,
 | 
			
		||||
/* 197 */
 | 
			
		||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
 | 
			
		||||
 | 
			
		||||
@ -6117,7 +6092,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
 | 
			
		||||
exports.run = void 0;
 | 
			
		||||
const core = __importStar(__webpack_require__(470));
 | 
			
		||||
const gpg = __importStar(__webpack_require__(884));
 | 
			
		||||
const constants = __importStar(__webpack_require__(196));
 | 
			
		||||
const constants = __importStar(__webpack_require__(694));
 | 
			
		||||
const util_1 = __webpack_require__(322);
 | 
			
		||||
const cache_1 = __webpack_require__(913);
 | 
			
		||||
function removePrivateKeyFromKeychain() {
 | 
			
		||||
@ -6914,8 +6889,7 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
 | 
			
		||||
            //
 | 
			
		||||
            // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
 | 
			
		||||
            // on 64-bit systems), split the download into multiple segments
 | 
			
		||||
            // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
 | 
			
		||||
            const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
 | 
			
		||||
            const maxSegmentSize = buffer.constants.MAX_LENGTH;
 | 
			
		||||
            const downloadProgress = new DownloadProgress(contentLength);
 | 
			
		||||
            const fd = fs.openSync(archivePath, 'w');
 | 
			
		||||
            try {
 | 
			
		||||
@ -9136,15 +9110,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
 | 
			
		||||
    return (mod && mod.__esModule) ? mod : { "default": mod };
 | 
			
		||||
};
 | 
			
		||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
			
		||||
exports.isCacheFeatureAvailable = exports.isGhes = exports.isJobStatusSuccess = exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
 | 
			
		||||
exports.isJobStatusSuccess = exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
 | 
			
		||||
const os_1 = __importDefault(__webpack_require__(87));
 | 
			
		||||
const path_1 = __importDefault(__webpack_require__(622));
 | 
			
		||||
const fs = __importStar(__webpack_require__(747));
 | 
			
		||||
const semver = __importStar(__webpack_require__(876));
 | 
			
		||||
const cache = __importStar(__webpack_require__(692));
 | 
			
		||||
const core = __importStar(__webpack_require__(470));
 | 
			
		||||
const tc = __importStar(__webpack_require__(533));
 | 
			
		||||
const constants_1 = __webpack_require__(196);
 | 
			
		||||
const constants_1 = __webpack_require__(694);
 | 
			
		||||
function getTempDir() {
 | 
			
		||||
    let tempDirectory = process.env['RUNNER_TEMP'] || os_1.default.tmpdir();
 | 
			
		||||
    return tempDirectory;
 | 
			
		||||
@ -9214,24 +9187,6 @@ function isJobStatusSuccess() {
 | 
			
		||||
    return jobStatus === 'success';
 | 
			
		||||
}
 | 
			
		||||
exports.isJobStatusSuccess = isJobStatusSuccess;
 | 
			
		||||
function isGhes() {
 | 
			
		||||
    const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
 | 
			
		||||
    return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
 | 
			
		||||
}
 | 
			
		||||
exports.isGhes = isGhes;
 | 
			
		||||
function isCacheFeatureAvailable() {
 | 
			
		||||
    if (!cache.isFeatureAvailable()) {
 | 
			
		||||
        if (isGhes()) {
 | 
			
		||||
            throw new Error('Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not.');
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            core.warning('The runner was not able to contact the cache service. Caching will be skipped');
 | 
			
		||||
        }
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
@ -41998,7 +41953,7 @@ __exportStar(__webpack_require__(220), exports);
 | 
			
		||||
__exportStar(__webpack_require__(932), exports);
 | 
			
		||||
__exportStar(__webpack_require__(975), exports);
 | 
			
		||||
__exportStar(__webpack_require__(207), exports);
 | 
			
		||||
__exportStar(__webpack_require__(694), exports);
 | 
			
		||||
__exportStar(__webpack_require__(773), exports);
 | 
			
		||||
__exportStar(__webpack_require__(695), exports);
 | 
			
		||||
var spancontext_utils_1 = __webpack_require__(629);
 | 
			
		||||
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });
 | 
			
		||||
@ -53551,15 +53506,6 @@ function checkKey(key) {
 | 
			
		||||
        throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
/**
 | 
			
		||||
 * isFeatureAvailable to check the presence of Actions cache service
 | 
			
		||||
 *
 | 
			
		||||
 * @returns boolean return true if Actions cache service feature is available, otherwise false
 | 
			
		||||
 */
 | 
			
		||||
function isFeatureAvailable() {
 | 
			
		||||
    return !!process.env['ACTIONS_CACHE_URL'];
 | 
			
		||||
}
 | 
			
		||||
exports.isFeatureAvailable = isFeatureAvailable;
 | 
			
		||||
/**
 | 
			
		||||
 * Restores cache from keys
 | 
			
		||||
 *
 | 
			
		||||
@ -53680,23 +53626,28 @@ exports.saveCache = saveCache;
 | 
			
		||||
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright The OpenTelemetry Authors
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *      https://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
			
		||||
//# sourceMappingURL=tracer_provider.js.map
 | 
			
		||||
exports.STATE_GPG_PRIVATE_KEY_FINGERPRINT = exports.INPUT_JOB_STATUS = exports.INPUT_CACHE = exports.INPUT_DEFAULT_GPG_PASSPHRASE = exports.INPUT_DEFAULT_GPG_PRIVATE_KEY = exports.INPUT_GPG_PASSPHRASE = exports.INPUT_GPG_PRIVATE_KEY = exports.INPUT_OVERWRITE_SETTINGS = exports.INPUT_SETTINGS_PATH = exports.INPUT_SERVER_PASSWORD = exports.INPUT_SERVER_USERNAME = exports.INPUT_SERVER_ID = exports.INPUT_CHECK_LATEST = exports.INPUT_JDK_FILE = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_ARCHITECTURE = exports.INPUT_JAVA_VERSION = exports.MACOS_JAVA_CONTENT_POSTFIX = void 0;
 | 
			
		||||
exports.MACOS_JAVA_CONTENT_POSTFIX = 'Contents/Home';
 | 
			
		||||
exports.INPUT_JAVA_VERSION = 'java-version';
 | 
			
		||||
exports.INPUT_ARCHITECTURE = 'architecture';
 | 
			
		||||
exports.INPUT_JAVA_PACKAGE = 'java-package';
 | 
			
		||||
exports.INPUT_DISTRIBUTION = 'distribution';
 | 
			
		||||
exports.INPUT_JDK_FILE = 'jdkFile';
 | 
			
		||||
exports.INPUT_CHECK_LATEST = 'check-latest';
 | 
			
		||||
exports.INPUT_SERVER_ID = 'server-id';
 | 
			
		||||
exports.INPUT_SERVER_USERNAME = 'server-username';
 | 
			
		||||
exports.INPUT_SERVER_PASSWORD = 'server-password';
 | 
			
		||||
exports.INPUT_SETTINGS_PATH = 'settings-path';
 | 
			
		||||
exports.INPUT_OVERWRITE_SETTINGS = 'overwrite-settings';
 | 
			
		||||
exports.INPUT_GPG_PRIVATE_KEY = 'gpg-private-key';
 | 
			
		||||
exports.INPUT_GPG_PASSPHRASE = 'gpg-passphrase';
 | 
			
		||||
exports.INPUT_DEFAULT_GPG_PRIVATE_KEY = undefined;
 | 
			
		||||
exports.INPUT_DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE';
 | 
			
		||||
exports.INPUT_CACHE = 'cache';
 | 
			
		||||
exports.INPUT_JOB_STATUS = 'job-status';
 | 
			
		||||
exports.STATE_GPG_PRIVATE_KEY_FINGERPRINT = 'gpg-private-key-fingerprint';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
/* 695 */
 | 
			
		||||
@ -55763,7 +55714,30 @@ module.exports = function(dst, src) {
 | 
			
		||||
/* 770 */,
 | 
			
		||||
/* 771 */,
 | 
			
		||||
/* 772 */,
 | 
			
		||||
/* 773 */,
 | 
			
		||||
/* 773 */
 | 
			
		||||
/***/ (function(__unusedmodule, exports) {
 | 
			
		||||
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright The OpenTelemetry Authors
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *      https://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
			
		||||
//# sourceMappingURL=tracer_provider.js.map
 | 
			
		||||
 | 
			
		||||
/***/ }),
 | 
			
		||||
/* 774 */,
 | 
			
		||||
/* 775 */,
 | 
			
		||||
/* 776 */,
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1302
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1302
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										38
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										38
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -1,15 +1,15 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "setup-java",
 | 
			
		||||
  "version": "3.1.0",
 | 
			
		||||
  "version": "2.0.0",
 | 
			
		||||
  "lockfileVersion": 2,
 | 
			
		||||
  "requires": true,
 | 
			
		||||
  "packages": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "name": "setup-java",
 | 
			
		||||
      "version": "3.1.0",
 | 
			
		||||
      "version": "2.0.0",
 | 
			
		||||
      "license": "MIT",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@actions/cache": "^2.0.0",
 | 
			
		||||
        "@actions/cache": "^1.0.8",
 | 
			
		||||
        "@actions/core": "^1.2.6",
 | 
			
		||||
        "@actions/exec": "^1.0.4",
 | 
			
		||||
        "@actions/glob": "^0.2.0",
 | 
			
		||||
@ -32,17 +32,17 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@actions/cache": {
 | 
			
		||||
      "version": "2.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==",
 | 
			
		||||
      "version": "1.0.8",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.8.tgz",
 | 
			
		||||
      "integrity": "sha512-GWNNB67w93HGJRQXlsV56YqrdAuDoP3esK/mo5mzU8WoDCVjtQgJGsTdkYUX7brswtT7xnI30bWNo1WLKQ8FZQ==",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@actions/core": "^1.2.6",
 | 
			
		||||
        "@actions/exec": "^1.0.1",
 | 
			
		||||
        "@actions/glob": "^0.1.0",
 | 
			
		||||
        "@actions/http-client": "^1.0.9",
 | 
			
		||||
        "@actions/io": "^1.0.1",
 | 
			
		||||
        "@azure/ms-rest-js": "^2.6.0",
 | 
			
		||||
        "@azure/storage-blob": "^12.8.0",
 | 
			
		||||
        "@azure/ms-rest-js": "^2.0.7",
 | 
			
		||||
        "@azure/storage-blob": "^12.1.2",
 | 
			
		||||
        "semver": "^6.1.0",
 | 
			
		||||
        "uuid": "^3.3.3"
 | 
			
		||||
      }
 | 
			
		||||
@ -5557,9 +5557,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/minimist": {
 | 
			
		||||
      "version": "1.2.6",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
 | 
			
		||||
      "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
 | 
			
		||||
      "version": "1.2.5",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
 | 
			
		||||
      "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/ms": {
 | 
			
		||||
@ -6662,17 +6662,17 @@
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@actions/cache": {
 | 
			
		||||
      "version": "2.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==",
 | 
			
		||||
      "version": "1.0.8",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.8.tgz",
 | 
			
		||||
      "integrity": "sha512-GWNNB67w93HGJRQXlsV56YqrdAuDoP3esK/mo5mzU8WoDCVjtQgJGsTdkYUX7brswtT7xnI30bWNo1WLKQ8FZQ==",
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@actions/core": "^1.2.6",
 | 
			
		||||
        "@actions/exec": "^1.0.1",
 | 
			
		||||
        "@actions/glob": "^0.1.0",
 | 
			
		||||
        "@actions/http-client": "^1.0.9",
 | 
			
		||||
        "@actions/io": "^1.0.1",
 | 
			
		||||
        "@azure/ms-rest-js": "^2.6.0",
 | 
			
		||||
        "@azure/storage-blob": "^12.8.0",
 | 
			
		||||
        "@azure/ms-rest-js": "^2.0.7",
 | 
			
		||||
        "@azure/storage-blob": "^12.1.2",
 | 
			
		||||
        "semver": "^6.1.0",
 | 
			
		||||
        "uuid": "^3.3.3"
 | 
			
		||||
      },
 | 
			
		||||
@ -11060,9 +11060,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "minimist": {
 | 
			
		||||
      "version": "1.2.6",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
 | 
			
		||||
      "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
 | 
			
		||||
      "version": "1.2.5",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
 | 
			
		||||
      "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "ms": {
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "setup-java",
 | 
			
		||||
  "version": "3.1.0",
 | 
			
		||||
  "version": "2.0.0",
 | 
			
		||||
  "private": true,
 | 
			
		||||
  "description": "setup java action",
 | 
			
		||||
  "main": "dist/setup/index.js",
 | 
			
		||||
@ -24,7 +24,7 @@
 | 
			
		||||
  "author": "GitHub",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@actions/cache": "^2.0.0",
 | 
			
		||||
    "@actions/cache": "^1.0.8",
 | 
			
		||||
    "@actions/core": "^1.2.6",
 | 
			
		||||
    "@actions/exec": "^1.0.4",
 | 
			
		||||
    "@actions/glob": "^0.2.0",
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import * as core from '@actions/core';
 | 
			
		||||
import * as auth from './auth';
 | 
			
		||||
import { getBooleanInput, isCacheFeatureAvailable } from './util';
 | 
			
		||||
import { getBooleanInput } from './util';
 | 
			
		||||
import * as constants from './constants';
 | 
			
		||||
import { restore } from './cache';
 | 
			
		||||
import * as path from 'path';
 | 
			
		||||
@ -42,7 +42,7 @@ async function run() {
 | 
			
		||||
    core.info(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
 | 
			
		||||
 | 
			
		||||
    await auth.configureAuthentication();
 | 
			
		||||
    if (cache && isCacheFeatureAvailable()) {
 | 
			
		||||
    if (cache) {
 | 
			
		||||
      await restore(cache);
 | 
			
		||||
    }
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										24
									
								
								src/util.ts
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								src/util.ts
									
									
									
									
									
								
							@ -2,7 +2,6 @@ import os from 'os';
 | 
			
		||||
import path from 'path';
 | 
			
		||||
import * as fs from 'fs';
 | 
			
		||||
import * as semver from 'semver';
 | 
			
		||||
import * as cache from '@actions/cache';
 | 
			
		||||
import * as core from '@actions/core';
 | 
			
		||||
 | 
			
		||||
import * as tc from '@actions/tool-cache';
 | 
			
		||||
@ -52,7 +51,7 @@ export function getDownloadArchiveExtension() {
 | 
			
		||||
export function isVersionSatisfies(range: string, version: string): boolean {
 | 
			
		||||
  if (semver.valid(range)) {
 | 
			
		||||
    // if full version with build digit is provided as a range (such as '1.2.3+4')
 | 
			
		||||
    // we should check for exact equal via compareBuild
 | 
			
		||||
    // Tes we should check for exact equal via compareBuild
 | 
			
		||||
    // since semver.satisfies doesn't handle 4th digit
 | 
			
		||||
    const semRange = semver.parse(range);
 | 
			
		||||
    if (semRange && semRange.build?.length > 0) {
 | 
			
		||||
@ -78,24 +77,3 @@ export function isJobStatusSuccess() {
 | 
			
		||||
 | 
			
		||||
  return jobStatus === 'success';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function isGhes(): boolean {
 | 
			
		||||
  const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
 | 
			
		||||
  return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function isCacheFeatureAvailable(): boolean {
 | 
			
		||||
  if (!cache.isFeatureAvailable()) {
 | 
			
		||||
    if (isGhes()) {
 | 
			
		||||
      throw new Error(
 | 
			
		||||
        'Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not.'
 | 
			
		||||
      );
 | 
			
		||||
    } else {
 | 
			
		||||
      core.warning('The runner was not able to contact the cache service. Caching will be skipped');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user