@@ -4969,6 +4969,26 @@ class BaseUtilLib {
4969
4969
this.baseLib.info(`Set the step output variable '${name}' to value '${value}''`);
4970
4970
this.baseLib.setOutput(name, value);
4971
4971
}
4972
+ /**
4973
+ * Set a workflow variable if not set already.
4974
+ * @param name The name of the variable.
4975
+ * @param value The value.
4976
+ */
4977
+ setVariableIfUndefined(name, value) {
4978
+ this.baseLib.debug(`setVariableIfUndefined()<<`);
4979
+ if (!process.env[name]) {
4980
+ if (!value) {
4981
+ this.baseLib.warning(`Cannot set '${name}' variable because the provided value is null.`);
4982
+ }
4983
+ else {
4984
+ this.setVariableVerbose(name, value);
4985
+ }
4986
+ }
4987
+ else {
4988
+ this.baseLib.debug(`${name} is already set to: '${value}'`);
4989
+ }
4990
+ this.baseLib.debug(`setVariableIfUndefined()>>`);
4991
+ }
4972
4992
}
4973
4993
exports.BaseUtilLib = BaseUtilLib;
4974
4994
class Matcher {
@@ -5585,7 +5605,7 @@ __exportStar(__nccwpck_require__(6188), exports);
5585
5605
// Released under the term specified in file LICENSE.txt
5586
5606
// SPDX short identifier: MIT
5587
5607
Object.defineProperty(exports, "__esModule", ({ value: true }));
5588
- exports.VCPKG_BINARY_SOURCES = exports.VCPKG_INSTALLED_DIR = exports.VCPKG_JSON = exports.VCPKGDEFAULTTRIPLET = exports.VCPKGROOT = exports.vcpkgLastBuiltCommitId = exports.RUNVCPKG_VCPKG_DEFAULT_TRIPLET = exports.RUNVCPKG_VCPKG_ROOT = void 0;
5608
+ exports.ACTIONS_RUNTIME_TOKEN = exports.ACTIONS_CACHE_URL = exports. VCPKG_BINARY_SOURCES = exports.VCPKG_INSTALLED_DIR = exports.VCPKG_JSON = exports.VCPKGDEFAULTTRIPLET = exports.VCPKGROOT = exports.vcpkgLastBuiltCommitId = exports.RUNVCPKG_VCPKG_DEFAULT_TRIPLET = exports.RUNVCPKG_VCPKG_ROOT = void 0;
5589
5609
exports.RUNVCPKG_VCPKG_ROOT = "RUNVCPKG_VCPKG_ROOT";
5590
5610
exports.RUNVCPKG_VCPKG_DEFAULT_TRIPLET = "RUNVCPKG_VCPKG_DEFAULT_TRIPLET";
5591
5611
exports.vcpkgLastBuiltCommitId = 'vcpkgLastBuiltCommitId';
@@ -5594,6 +5614,8 @@ exports.VCPKGDEFAULTTRIPLET = "VCPKG_DEFAULT_TRIPLET";
5594
5614
exports.VCPKG_JSON = "vcpkg.json";
5595
5615
exports.VCPKG_INSTALLED_DIR = "VCPKG_INSTALLED_DIR";
5596
5616
exports.VCPKG_BINARY_SOURCES = `VCPKG_BINARY_SOURCES`;
5617
+ exports.ACTIONS_CACHE_URL = `ACTIONS_CACHE_URL`;
5618
+ exports.ACTIONS_RUNTIME_TOKEN = `ACTIONS_RUNTIME_TOKEN`;
5597
5619
//# sourceMappingURL=vcpkg-globals.js.map
5598
5620
5599
5621
/***/ }),
@@ -5718,9 +5740,12 @@ class VcpkgRunner {
5718
5740
// If running in a GitHub Runner, enable the GH's cache provider for the vcpkg's binary cache.
5719
5741
if (process.env['GITHUB_ACTIONS'] === 'true') {
5720
5742
yield this.baseUtils.wrapOp(`Setup to run on GitHub Action runners`, () => __awaiter(this, void 0, void 0, function* () {
5721
- // Allow users to define the vcpkg's binary source explicitly in the workflow, in that case don't override it.
5722
- if (!process.env[globals.VCPKG_BINARY_SOURCES])
5723
- this.baseUtils.setVariableVerbose(globals.VCPKG_BINARY_SOURCES, VcpkgRunner.VCPKG_BINARY_SOURCES_GHA);
5743
+ // Allow users to define the vcpkg's binary source explicitly in the workflow, in that case do not override it.
5744
+ this.baseUtils.setVariableIfUndefined(globals.VCPKG_BINARY_SOURCES, VcpkgRunner.VCPKG_BINARY_SOURCES_GHA);
5745
+ if (process.env.ACTIONS_CACHE_URL)
5746
+ this.baseUtils.setVariableVerbose(globals.ACTIONS_CACHE_URL, process.env.ACTIONS_CACHE_URL);
5747
+ if (process.env.ACTIONS_RUNTIME_TOKEN)
5748
+ this.baseUtils.setVariableVerbose(globals.ACTIONS_RUNTIME_TOKEN, process.env.ACTIONS_RUNTIME_TOKEN);
5724
5749
}));
5725
5750
}
5726
5751
// Ensuring `this.vcpkgDestPath` is existent, since is going to be used as current working directory.
0 commit comments