Bump artifact dependencies if CODEQL_ACTION_ARTIFACT_V2_UPGRADE enabled (#2482)
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com> Co-authored-by: Henry Mercer <henrymercer@github.com>
This commit is contained in:
parent
cf5b0a9041
commit
a196a714b8
5388 changed files with 2176737 additions and 71701 deletions
54
node_modules/@actions/artifact/lib/internal/upload/retention.js
generated
vendored
Normal file
54
node_modules/@actions/artifact/lib/internal/upload/retention.js
generated
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
"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;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getExpiration = void 0;
|
||||
const generated_1 = require("../../generated");
|
||||
const core = __importStar(require("@actions/core"));
|
||||
function getExpiration(retentionDays) {
|
||||
if (!retentionDays) {
|
||||
return undefined;
|
||||
}
|
||||
const maxRetentionDays = getRetentionDays();
|
||||
if (maxRetentionDays && maxRetentionDays < retentionDays) {
|
||||
core.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`);
|
||||
retentionDays = maxRetentionDays;
|
||||
}
|
||||
const expirationDate = new Date();
|
||||
expirationDate.setDate(expirationDate.getDate() + retentionDays);
|
||||
return generated_1.Timestamp.fromDate(expirationDate);
|
||||
}
|
||||
exports.getExpiration = getExpiration;
|
||||
function getRetentionDays() {
|
||||
const retentionDays = process.env['GITHUB_RETENTION_DAYS'];
|
||||
if (!retentionDays) {
|
||||
return undefined;
|
||||
}
|
||||
const days = parseInt(retentionDays);
|
||||
if (isNaN(days)) {
|
||||
return undefined;
|
||||
}
|
||||
return days;
|
||||
}
|
||||
//# sourceMappingURL=retention.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue