Skip to content

Commit e9b926d

Browse files
committed
Deploy Production Code for Commit 7446b3d 🚀
1 parent 7446b3d commit e9b926d

File tree

142 files changed

+1330
-13010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1330
-13010
lines changed

lib/constants.d.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/// <reference types="node" />
1+
/**
2+
* Required action data that gets initialized when running within the GitHub Actions environment.
3+
*/
24
export interface ActionInterface {
35
/** Allows you to log the retrieved data to the terminal. */
46
debug?: boolean;
@@ -25,6 +27,9 @@ export interface ActionInterface {
2527
/** The variable name the data exports as. */
2628
variableName?: string;
2729
}
30+
/**
31+
* Required data to fetch the data.
32+
*/
2833
export interface DataInterface {
2934
/** Allows you to log the retrieved data to the terminal. */
3035
debug?: boolean;
@@ -39,6 +44,9 @@ export interface DataInterface {
3944
/** Optional configuration that allows the fetch request to make a series of retry requests before failing. */
4045
retry?: boolean | null;
4146
}
47+
/**
48+
* Required data to export the data.
49+
*/
4250
export interface ExportInterface {
4351
/** The data to save. */
4452
data: string;
@@ -55,6 +63,9 @@ export interface ExportInterface {
5563
/** The variable name the data exports as. */
5664
variableName?: string;
5765
}
66+
/**
67+
* Required action data that gets initialized when running within the GitHub Actions environment.
68+
*/
5869
export declare const action: {
5970
debug: boolean;
6071
encoding: BufferEncoding;

lib/constants.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
exports.Status = exports.action = void 0;
44
const core_1 = require("@actions/core");
55
const util_1 = require("./util");
6-
// Required action data that gets initialized when running within the GitHub Actions environment.
6+
/**
7+
* Required action data that gets initialized when running within the GitHub Actions environment.
8+
*/
79
exports.action = {
810
debug: !(0, util_1.isNullOrUndefined)((0, core_1.getInput)('debug'))
911
? (0, core_1.getInput)('debug').toLowerCase() === 'true'

lib/fetch.d.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import 'cross-fetch/polyfill';
21
import { DataInterface, ExportInterface, Status } from './constants';
2+
/**
3+
* Retrieves data from an API endpoint.
4+
*/
35
export declare function retrieveData({ debug: requestDebug, endpoint, configuration, auth, isTokenRequest, retry }: DataInterface): Promise<string>;
6+
/**
7+
* Generates an export file from the data provided.
8+
*/
49
export declare function generateExport({ data, encoding, format, saveLocation, saveName, setOutput, variableName }: ExportInterface): Promise<Status>;

lib/fetch.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1212
return (mod && mod.__esModule) ? mod : { "default": mod };
1313
};
1414
Object.defineProperty(exports, "__esModule", { value: true });
15-
exports.generateExport = exports.retrieveData = void 0;
15+
exports.retrieveData = retrieveData;
16+
exports.generateExport = generateExport;
1617
const core_1 = require("@actions/core");
1718
const io_1 = require("@actions/io");
18-
require("cross-fetch/polyfill");
1919
const fs_1 = require("fs");
2020
const mustache_1 = require("mustache");
2121
const async_retry_1 = __importDefault(require("async-retry"));
2222
const constants_1 = require("./constants");
2323
const util_1 = require("./util");
24-
/* Fetches or Posts data to an API. If auth is provided it will replace the mustache variables with the data from it. */
24+
/**
25+
* Retrieves data from an API endpoint.
26+
*/
2527
function retrieveData(_a) {
2628
return __awaiter(this, arguments, void 0, function* ({ debug: requestDebug, endpoint, configuration, auth, isTokenRequest, retry }) {
2729
try {
@@ -60,8 +62,9 @@ function retrieveData(_a) {
6062
}
6163
});
6264
}
63-
exports.retrieveData = retrieveData;
64-
/* Saves the data to the local file system and exports an environment variable containing the retrieved data. */
65+
/**
66+
* Generates an export file from the data provided.
67+
*/
6568
function generateExport(_a) {
6669
return __awaiter(this, arguments, void 0, function* ({ data, encoding, format, saveLocation, saveName, setOutput, variableName }) {
6770
(0, core_1.info)('Saving the data... 📁');
@@ -86,4 +89,3 @@ function generateExport(_a) {
8689
}
8790
});
8891
}
89-
exports.generateExport = generateExport;

lib/lib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1010
};
1111
Object.defineProperty(exports, "__esModule", { value: true });
1212
exports.generateExport = exports.retrieveData = void 0;
13+
exports.default = run;
1314
const core_1 = require("@actions/core");
1415
const constants_1 = require("./constants");
1516
const fetch_1 = require("./fetch");
@@ -72,4 +73,3 @@ function run(configuration) {
7273
}
7374
});
7475
}
75-
exports.default = run;

lib/util.d.ts

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
import { ActionInterface } from './constants';
2+
/**
3+
* Checks to see if a value is null or undefined.
4+
*/
25
export declare const isNullOrUndefined: (value: string | undefined | null) => boolean;
6+
/**
7+
* Checks to see if the action has the required parameters to run.
8+
*/
39
export declare const hasRequiredParameters: (action: ActionInterface) => void;
10+
/**
11+
* Extracts the error message from an error object or string.
12+
*/
413
export declare const extractErrorMessage: (error: unknown) => string;
14+
/**
15+
* Parses a string into a JSON object.
16+
*/
517
export declare const parseData: (data: string) => Record<string, unknown> | null;

lib/util.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.parseData = exports.extractErrorMessage = exports.hasRequiredParameters = exports.isNullOrUndefined = void 0;
4-
/* Utility function that checks to see if a value is undefined or not. */
4+
/**
5+
* Checks to see if a value is null or undefined.
6+
*/
57
const isNullOrUndefined = (value) => typeof value === 'undefined' || value === null || value === '';
68
exports.isNullOrUndefined = isNullOrUndefined;
7-
/* Checks for the required inputs. Throws an error if any case is matched. */
9+
/**
10+
* Checks to see if the action has the required parameters to run.
11+
*/
812
const hasRequiredParameters = (action) => {
913
if ((0, exports.isNullOrUndefined)(action.endpoint)) {
1014
throw new Error('You must provide the action with at least an endpoint to retrieve data from.');
1115
}
1216
};
1317
exports.hasRequiredParameters = hasRequiredParameters;
18+
/**
19+
* Extracts the error message from an error object or string.
20+
*/
1421
const extractErrorMessage = (error) => error instanceof Error
1522
? error.message
1623
: typeof error == 'string'
1724
? error
1825
: JSON.stringify(error);
1926
exports.extractErrorMessage = extractErrorMessage;
20-
/* Attempt to parse data as JSON and catch any errors. */
27+
/**
28+
* Parses a string into a JSON object.
29+
*/
2130
const parseData = (data) => {
2231
try {
2332
return JSON.parse(data);

node_modules/.bin/uuid

-1
This file was deleted.

node_modules/@actions/core/README.md

+151
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@actions/core/lib/command.js

+8-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@actions/core/lib/command.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/@actions/core/lib/core.d.ts

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)