Skip to content

Commit 3b49449

Browse files
committed
Deploy Production Code for Commit bc9b212 πŸš€
1 parent bc9b212 commit 3b49449

30 files changed

+2557
-315
lines changed

β€Žlib/constants.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export interface ActionInterface {
1616
saveLocation?: string;
1717
/** The save name of the exported file. */
1818
saveName?: string;
19+
/** Determines if the output shoudl be saved or not. */
20+
setOutput: boolean;
1921
/** The format of the file being saved. */
2022
format?: string;
2123
/** Optional configuration that allows the fetch request to make a series of retry requests before failing. */
@@ -44,6 +46,8 @@ export interface ExportInterface {
4446
saveLocation?: string;
4547
/** The name of the file to save. */
4648
saveName?: string;
49+
/** Determines if the output shoudl be saved or not. */
50+
setOutput: boolean;
4751
/** The format of the file to save. */
4852
format?: string;
4953
}
@@ -57,6 +61,7 @@ export declare const action: {
5761
tokenConfiguration: string;
5862
saveLocation: string;
5963
saveName: string;
64+
setOutput: boolean;
6065
format: string;
6166
};
6267
/** Status codes for the action. */

β€Žlib/constants.js

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ exports.action = {
1818
tokenConfiguration: (0, core_1.getInput)('token-configuration'),
1919
saveLocation: (0, core_1.getInput)('save-location'),
2020
saveName: (0, core_1.getInput)('save-name'),
21+
setOutput: !(0, util_1.isNullOrUndefined)((0, core_1.getInput)('set-output'))
22+
? (0, core_1.getInput)('set-output').toLowerCase() === 'true'
23+
: false,
2124
format: (0, core_1.getInput)('format')
2225
};
2326
/** Status codes for the action. */

β€Žlib/fetch.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import 'cross-fetch/polyfill';
22
import { DataInterface, ExportInterface, Status } from './constants';
33
export declare function retrieveData({ debug: requestDebug, endpoint, configuration, auth, isTokenRequest, retry }: DataInterface): Promise<string>;
4-
export declare function generateExport({ data, encoding, format, saveLocation, saveName }: ExportInterface): Promise<Status>;
4+
export declare function generateExport({ data, encoding, format, saveLocation, saveName, setOutput }: ExportInterface): Promise<Status>;

β€Žlib/fetch.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function retrieveData({ debug: requestDebug, endpoint, configuration, auth, isTo
6262
}
6363
exports.retrieveData = retrieveData;
6464
/* Saves the data to the local file system and exports an environment variable containing the retrieved data. */
65-
function generateExport({ data, encoding, format, saveLocation, saveName }) {
65+
function generateExport({ data, encoding, format, saveLocation, saveName, setOutput }) {
6666
return __awaiter(this, void 0, void 0, function* () {
6767
(0, core_1.info)('Saving the data... πŸ“');
6868
const file = `${saveLocation ? saveLocation : 'fetch-api-data-action'}/${saveName ? saveName : 'data'}.${format ? format : 'json'}`;
@@ -71,7 +71,9 @@ function generateExport({ data, encoding, format, saveLocation, saveName }) {
7171
yield (0, io_1.mkdirP)(`${saveLocation ? saveLocation : 'fetch-api-data-action'}`);
7272
yield fs_1.promises.writeFile(file, data, dataEncoding);
7373
(0, core_1.info)(`Saved ${file} πŸ’Ύ`);
74-
(0, core_1.exportVariable)('fetch-api-data', data);
74+
if (setOutput) {
75+
(0, core_1.exportVariable)('fetch-api-data', data);
76+
}
7577
return constants_1.Status.SUCCESS;
7678
}
7779
catch (error) {

β€Žlib/lib.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function run(configuration) {
5858
encoding: settings.encoding,
5959
saveLocation: settings.saveLocation,
6060
saveName: settings.saveName,
61-
format: settings.format
61+
format: settings.format,
62+
setOutput: settings.setOutput
6263
});
6364
}
6465
catch (error) {

β€Žnode_modules/cross-fetch/dist/browser-polyfill.js

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

β€Žnode_modules/cross-fetch/dist/browser-ponyfill.js

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

β€Žnode_modules/cross-fetch/package.json

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

0 commit comments

Comments
Β (0)