mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-26 08:28:28 +02:00
ensure defaults for configuration values
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
This commit is contained in:
parent
10ec34d92d
commit
59bb9ed754
4 changed files with 23 additions and 34 deletions
|
@ -9,8 +9,13 @@ inputs:
|
||||||
description: 'Destination path'
|
description: 'Destination path'
|
||||||
required: false
|
required: false
|
||||||
s3-bucket:
|
s3-bucket:
|
||||||
description: 'S3 bucket to pull from'
|
description: >
|
||||||
required: false
|
S3 Bucket to use to put your artifacts in, typically something like "gha-artifacts"
|
||||||
|
default: 'gha-artifacts'
|
||||||
|
region:
|
||||||
|
description: >
|
||||||
|
Region your s3 bucket is in
|
||||||
|
default: 'us-east-1'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|
42
dist/index.js
vendored
42
dist/index.js
vendored
|
@ -19,13 +19,7 @@ module.exports =
|
||||||
/******/ };
|
/******/ };
|
||||||
/******/
|
/******/
|
||||||
/******/ // Execute the module function
|
/******/ // Execute the module function
|
||||||
/******/ var threw = true;
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||||
/******/ try {
|
|
||||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
||||||
/******/ threw = false;
|
|
||||||
/******/ } finally {
|
|
||||||
/******/ if(threw) delete installedModules[moduleId];
|
|
||||||
/******/ }
|
|
||||||
/******/
|
/******/
|
||||||
/******/ // Flag the module as loaded
|
/******/ // Flag the module as loaded
|
||||||
/******/ module.l = true;
|
/******/ module.l = true;
|
||||||
|
@ -5450,12 +5444,12 @@ module.exports = {"metadata":{"apiVersion":"2017-07-25","endpointPrefix":"dataex
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.Outputs = exports.Inputs = void 0;
|
|
||||||
var Inputs;
|
var Inputs;
|
||||||
(function (Inputs) {
|
(function (Inputs) {
|
||||||
Inputs["Name"] = "name";
|
Inputs["Name"] = "name";
|
||||||
Inputs["Path"] = "path";
|
Inputs["Path"] = "path";
|
||||||
Inputs["S3Bucket"] = "s3-bucket";
|
Inputs["S3Bucket"] = "s3-bucket";
|
||||||
|
Inputs["Region"] = "region";
|
||||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||||
var Outputs;
|
var Outputs;
|
||||||
(function (Outputs) {
|
(function (Outputs) {
|
||||||
|
@ -24762,7 +24756,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
||||||
var request = __webpack_require__(1753);
|
var request = __webpack_require__(1753);
|
||||||
var universalUserAgent = __webpack_require__(6796);
|
var universalUserAgent = __webpack_require__(6796);
|
||||||
|
|
||||||
const VERSION = "4.6.2";
|
const VERSION = "4.6.1";
|
||||||
|
|
||||||
class GraphqlError extends Error {
|
class GraphqlError extends Error {
|
||||||
constructor(request, response) {
|
constructor(request, response) {
|
||||||
|
@ -29858,7 +29852,6 @@ exports.getInput = getInput;
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function setOutput(name, value) {
|
function setOutput(name, value) {
|
||||||
process.stdout.write(os.EOL);
|
|
||||||
command_1.issueCommand('set-output', { name }, value);
|
command_1.issueCommand('set-output', { name }, value);
|
||||||
}
|
}
|
||||||
exports.setOutput = setOutput;
|
exports.setOutput = setOutput;
|
||||||
|
@ -31128,25 +31121,6 @@ exports.getUserAgent = getUserAgent;
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
@ -31156,6 +31130,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
@ -31173,6 +31154,7 @@ function run() {
|
||||||
const name = core.getInput(constants_1.Inputs.Name, { required: false });
|
const name = core.getInput(constants_1.Inputs.Name, { required: false });
|
||||||
const chosenPath = core.getInput(constants_1.Inputs.Path, { required: false });
|
const chosenPath = core.getInput(constants_1.Inputs.Path, { required: false });
|
||||||
const s3Bucket = core.getInput(constants_1.Inputs.S3Bucket, { required: false });
|
const s3Bucket = core.getInput(constants_1.Inputs.S3Bucket, { required: false });
|
||||||
|
const region = core.getInput(constants_1.Inputs.Region, { required: false });
|
||||||
let resolvedPath = '';
|
let resolvedPath = '';
|
||||||
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
|
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
|
||||||
if (chosenPath.startsWith(`~`)) {
|
if (chosenPath.startsWith(`~`)) {
|
||||||
|
@ -31183,7 +31165,7 @@ function run() {
|
||||||
resolvedPath = path_1.default.resolve(chosenPath);
|
resolvedPath = path_1.default.resolve(chosenPath);
|
||||||
}
|
}
|
||||||
core.debug(`Resolved path is ${resolvedPath}`);
|
core.debug(`Resolved path is ${resolvedPath}`);
|
||||||
const s3 = new AWS.S3();
|
const s3 = new AWS.S3({ region: region });
|
||||||
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${name}`;
|
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${name}`;
|
||||||
const s3Params = {
|
const s3Params = {
|
||||||
Bucket: s3Bucket,
|
Bucket: s3Bucket,
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
export enum Inputs {
|
export enum Inputs {
|
||||||
Name = 'name',
|
Name = 'name',
|
||||||
Path = 'path',
|
Path = 'path',
|
||||||
S3Bucket = 's3-bucket'
|
S3Bucket = 's3-bucket',
|
||||||
|
Region = 'region'
|
||||||
}
|
}
|
||||||
export enum Outputs {
|
export enum Outputs {
|
||||||
DownloadPath = 'download-path'
|
DownloadPath = 'download-path'
|
||||||
|
|
|
@ -11,6 +11,7 @@ async function run(): Promise<void> {
|
||||||
const name = core.getInput(Inputs.Name, {required: false})
|
const name = core.getInput(Inputs.Name, {required: false})
|
||||||
const chosenPath = core.getInput(Inputs.Path, {required: false})
|
const chosenPath = core.getInput(Inputs.Path, {required: false})
|
||||||
const s3Bucket = core.getInput(Inputs.S3Bucket, {required: false})
|
const s3Bucket = core.getInput(Inputs.S3Bucket, {required: false})
|
||||||
|
const region = core.getInput(Inputs.Region, {required: false})
|
||||||
|
|
||||||
let resolvedPath = ''
|
let resolvedPath = ''
|
||||||
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
|
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
|
||||||
|
@ -21,7 +22,7 @@ async function run(): Promise<void> {
|
||||||
resolvedPath = path.resolve(chosenPath)
|
resolvedPath = path.resolve(chosenPath)
|
||||||
}
|
}
|
||||||
core.debug(`Resolved path is ${resolvedPath}`)
|
core.debug(`Resolved path is ${resolvedPath}`)
|
||||||
const s3 = new AWS.S3()
|
const s3 = new AWS.S3({region: region})
|
||||||
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${name}`
|
const s3Prefix = `${github.context.repo.owner}/${github.context.repo.repo}/${github.context.runId}/${name}`
|
||||||
const s3Params = {
|
const s3Params = {
|
||||||
Bucket: s3Bucket,
|
Bucket: s3Bucket,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue