Skip to content

Commit

Permalink
Use latest toolkit version
Browse files Browse the repository at this point in the history
  • Loading branch information
n-g committed Feb 26, 2024
1 parent 859eb26 commit 9717d3c
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 7 deletions.
47 changes: 44 additions & 3 deletions dist/merge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2904,8 +2904,8 @@ class ArtifactHttpClient {
this.maxAttempts = 5;
this.baseRetryIntervalMilliseconds = 3000;
this.retryMultiplier = 1.5;
const token = (0, config_1.getRuntimeToken)();
this.baseUrl = (0, config_1.getResultsServiceUrl)();
const token = (0, config_1.getNamespaceToken)();
this.baseUrl = (0, config_1.getNamespaceResultsServiceUrl)();
if (maxAttempts) {
this.maxAttempts = maxAttempts;
}
Expand Down Expand Up @@ -3041,12 +3041,36 @@ exports.internalArtifactTwirpClient = internalArtifactTwirpClient;

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getResultsServiceUrl = exports.getRuntimeToken = exports.getUploadChunkSize = void 0;
exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getNamespaceResultsServiceUrl = exports.getResultsServiceUrl = exports.getNamespaceToken = exports.getRuntimeToken = exports.getUploadChunkSize = void 0;
const os_1 = __importDefault(__nccwpck_require__(22037));
const fs = __importStar(__nccwpck_require__(57147));
// Used for controlling the highWaterMark value of the zip that is being streamed
// The same value is used as the chunk size that is use during upload to blob storage
function getUploadChunkSize() {
Expand All @@ -3061,6 +3085,15 @@ function getRuntimeToken() {
return token;
}
exports.getRuntimeToken = getRuntimeToken;
function getNamespaceToken() {
const tokenFile = process.env['NSC_TOKEN_FILE'];
if (!tokenFile) {
throw new Error('Unable to get the NSC_TOKEN_FILE env variable');
}
const tokenJSON = fs.readFileSync(tokenFile, 'utf8');
return JSON.parse(tokenJSON).bearer_token;
}
exports.getNamespaceToken = getNamespaceToken;
function getResultsServiceUrl() {
const resultsUrl = process.env['ACTIONS_RESULTS_URL'];
if (!resultsUrl) {
Expand All @@ -3069,6 +3102,14 @@ function getResultsServiceUrl() {
return new URL(resultsUrl).origin;
}
exports.getResultsServiceUrl = getResultsServiceUrl;
function getNamespaceResultsServiceUrl() {
const resultsUrl = process.env['NAMESPACE_ACTIONS_RESULTS_URL'];
if (!resultsUrl) {
throw new Error('Unable to get the NAMESPACE_ACTIONS_RESULTS_URL env variable');
}
return new URL(resultsUrl).origin;
}
exports.getNamespaceResultsServiceUrl = getNamespaceResultsServiceUrl;
function isGhes() {
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
Expand Down
47 changes: 44 additions & 3 deletions dist/upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2904,8 +2904,8 @@ class ArtifactHttpClient {
this.maxAttempts = 5;
this.baseRetryIntervalMilliseconds = 3000;
this.retryMultiplier = 1.5;
const token = (0, config_1.getRuntimeToken)();
this.baseUrl = (0, config_1.getResultsServiceUrl)();
const token = (0, config_1.getNamespaceToken)();
this.baseUrl = (0, config_1.getNamespaceResultsServiceUrl)();
if (maxAttempts) {
this.maxAttempts = maxAttempts;
}
Expand Down Expand Up @@ -3041,12 +3041,36 @@ exports.internalArtifactTwirpClient = internalArtifactTwirpClient;

"use strict";

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getResultsServiceUrl = exports.getRuntimeToken = exports.getUploadChunkSize = void 0;
exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getNamespaceResultsServiceUrl = exports.getResultsServiceUrl = exports.getNamespaceToken = exports.getRuntimeToken = exports.getUploadChunkSize = void 0;
const os_1 = __importDefault(__nccwpck_require__(22037));
const fs = __importStar(__nccwpck_require__(57147));
// Used for controlling the highWaterMark value of the zip that is being streamed
// The same value is used as the chunk size that is use during upload to blob storage
function getUploadChunkSize() {
Expand All @@ -3061,6 +3085,15 @@ function getRuntimeToken() {
return token;
}
exports.getRuntimeToken = getRuntimeToken;
function getNamespaceToken() {
const tokenFile = process.env['NSC_TOKEN_FILE'];
if (!tokenFile) {
throw new Error('Unable to get the NSC_TOKEN_FILE env variable');
}
const tokenJSON = fs.readFileSync(tokenFile, 'utf8');
return JSON.parse(tokenJSON).bearer_token;
}
exports.getNamespaceToken = getNamespaceToken;
function getResultsServiceUrl() {
const resultsUrl = process.env['ACTIONS_RESULTS_URL'];
if (!resultsUrl) {
Expand All @@ -3069,6 +3102,14 @@ function getResultsServiceUrl() {
return new URL(resultsUrl).origin;
}
exports.getResultsServiceUrl = getResultsServiceUrl;
function getNamespaceResultsServiceUrl() {
const resultsUrl = process.env['NAMESPACE_ACTIONS_RESULTS_URL'];
if (!resultsUrl) {
throw new Error('Unable to get the NAMESPACE_ACTIONS_RESULTS_URL env variable');
}
return new URL(resultsUrl).origin;
}
exports.getNamespaceResultsServiceUrl = getNamespaceResultsServiceUrl;
function isGhes() {
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
Expand Down

0 comments on commit 9717d3c

Please sign in to comment.