Skip to content

Commit 951bcc6

Browse files
committed
merge main
2 parents 522a7e8 + 7080295 commit 951bcc6

File tree

75 files changed

+1532
-8033
lines changed

Some content is hidden

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

75 files changed

+1532
-8033
lines changed

.github/actions/javascript/authorChecklist/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16846,9 +16846,12 @@ exports["default"] = newComponentCategory;
1684616846
"use strict";
1684716847

1684816848
Object.defineProperty(exports, "__esModule", ({ value: true }));
16849-
const CONST = {
16849+
const GIT_CONST = {
1685016850
GITHUB_OWNER: 'Expensify',
1685116851
APP_REPO: 'App',
16852+
};
16853+
const CONST = {
16854+
...GIT_CONST,
1685216855
APPLAUSE_BOT: 'applausebot',
1685316856
OS_BOTIFY: 'OSBotify',
1685416857
LABELS: {
@@ -16857,11 +16860,9 @@ const CONST = {
1685716860
INTERNAL_QA: 'InternalQA',
1685816861
},
1685916862
DATE_FORMAT_STRING: 'yyyy-MM-dd',
16860-
APP_REPO_URL: '',
16861-
APP_REPO_GIT_URL: '',
16863+
APP_REPO_URL: `https://github.com/${GIT_CONST.GITHUB_OWNER}/${GIT_CONST.APP_REPO}`,
16864+
APP_REPO_GIT_URL: `[email protected]:${GIT_CONST.GITHUB_OWNER}/${GIT_CONST.APP_REPO}.git`,
1686216865
};
16863-
CONST.APP_REPO_URL = `https://github.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}`;
16864-
CONST.APP_REPO_GIT_URL = `[email protected]:${CONST.GITHUB_OWNER}/${CONST.APP_REPO}.git`;
1686516866
exports["default"] = CONST;
1686616867

1686716868

.github/actions/javascript/awaitStagingDeploys/awaitStagingDeploys.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/naming-convention */
22
import lodashThrottle from 'lodash/throttle';
3-
import ActionUtils from '@github/libs/ActionUtils';
3+
import {getStringInput} from '@github/libs/ActionUtils';
44
import CONST from '@github/libs/CONST';
55
import GitHubUtils, {POLL_RATE} from '@github/libs/GithubUtils';
66
import {promiseDoWhile} from '@github/libs/promiseWhile';
@@ -9,11 +9,11 @@ type CurrentStagingDeploys = Awaited<ReturnType<typeof GitHubUtils.octokit.actio
99

1010
function run() {
1111
console.info('[awaitStagingDeploys] run()');
12-
console.info('[awaitStagingDeploys] ActionUtils', ActionUtils);
12+
console.info('[awaitStagingDeploys] getStringInput', getStringInput);
1313
console.info('[awaitStagingDeploys] GitHubUtils', GitHubUtils);
1414
console.info('[awaitStagingDeploys] promiseDoWhile', promiseDoWhile);
1515

16-
const tag = ActionUtils.getStringInput('TAG', {required: false});
16+
const tag = getStringInput('TAG', {required: false});
1717
console.info('[awaitStagingDeploys] run() tag', tag);
1818

1919
let currentStagingDeploys: CurrentStagingDeploys = [];

.github/actions/javascript/awaitStagingDeploys/index.js

Lines changed: 119 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -4,108 +4,6 @@
44
/******/ (() => { // webpackBootstrap
55
/******/ var __webpack_modules__ = ({
66

7-
/***/ 970:
8-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
9-
10-
const core = __nccwpck_require__(2186);
11-
12-
/**
13-
* Safely parse a JSON input to a GitHub Action.
14-
*
15-
* @param {String} name - The name of the input.
16-
* @param {Object} options - Options to pass to core.getInput
17-
* @param {*} [defaultValue] - A default value to provide for the input.
18-
* Not required if the {required: true} option is given in the second arg to this function.
19-
* @returns {any}
20-
*/
21-
function getJSONInput(name, options, defaultValue = undefined) {
22-
const input = core.getInput(name, options);
23-
if (input) {
24-
return JSON.parse(input);
25-
}
26-
return defaultValue;
27-
}
28-
29-
/**
30-
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
31-
*
32-
* @param {String} name
33-
* @param {Object} options
34-
* @param {*} [defaultValue]
35-
* @returns {string|undefined}
36-
*/
37-
function getStringInput(name, options, defaultValue = undefined) {
38-
const input = core.getInput(name, options);
39-
if (!input) {
40-
return defaultValue;
41-
}
42-
return input;
43-
}
44-
45-
module.exports = {
46-
getJSONInput,
47-
getStringInput,
48-
};
49-
50-
51-
/***/ }),
52-
53-
/***/ 4502:
54-
/***/ ((module) => {
55-
56-
/**
57-
* Simulates a while loop where the condition is determined by the result of a Promise.
58-
*
59-
* @param {Function} condition
60-
* @param {Function} action
61-
* @returns {Promise}
62-
*/
63-
function promiseWhile(condition, action) {
64-
console.info('[promiseWhile] promiseWhile()');
65-
66-
return new Promise((resolve, reject) => {
67-
const loop = function () {
68-
if (!condition()) {
69-
resolve();
70-
} else {
71-
const actionResult = action();
72-
console.info('[promiseWhile] promiseWhile() actionResult', actionResult);
73-
Promise.resolve(actionResult).then(loop).catch(reject);
74-
}
75-
};
76-
loop();
77-
});
78-
}
79-
80-
/**
81-
* Simulates a do-while loop where the condition is determined by the result of a Promise.
82-
*
83-
* @param {Function} condition
84-
* @param {Function} action
85-
* @returns {Promise}
86-
*/
87-
function promiseDoWhile(condition, action) {
88-
console.info('[promiseWhile] promiseDoWhile()');
89-
90-
return new Promise((resolve, reject) => {
91-
console.info('[promiseWhile] promiseDoWhile() condition', condition);
92-
const actionResult = action();
93-
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);
94-
actionResult
95-
.then(() => promiseWhile(condition, action))
96-
.then(() => resolve())
97-
.catch(reject);
98-
});
99-
}
100-
101-
module.exports = {
102-
promiseWhile,
103-
promiseDoWhile,
104-
};
105-
106-
107-
/***/ }),
108-
1097
/***/ 7351:
1108
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
1119

@@ -12251,16 +12149,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1225112149
Object.defineProperty(exports, "__esModule", ({ value: true }));
1225212150
/* eslint-disable @typescript-eslint/naming-convention */
1225312151
const throttle_1 = __importDefault(__nccwpck_require__(2891));
12254-
const ActionUtils_1 = __importDefault(__nccwpck_require__(970));
12152+
const ActionUtils_1 = __nccwpck_require__(6981);
1225512153
const CONST_1 = __importDefault(__nccwpck_require__(9873));
1225612154
const GithubUtils_1 = __importStar(__nccwpck_require__(9296));
12257-
const promiseWhile_1 = __nccwpck_require__(4502);
12155+
const promiseWhile_1 = __nccwpck_require__(9438);
1225812156
function run() {
1225912157
console.info('[awaitStagingDeploys] run()');
12260-
console.info('[awaitStagingDeploys] ActionUtils', ActionUtils_1.default);
12158+
console.info('[awaitStagingDeploys] getStringInput', ActionUtils_1.getStringInput);
1226112159
console.info('[awaitStagingDeploys] GitHubUtils', GithubUtils_1.default);
1226212160
console.info('[awaitStagingDeploys] promiseDoWhile', promiseWhile_1.promiseDoWhile);
12263-
const tag = ActionUtils_1.default.getStringInput('TAG', { required: false });
12161+
const tag = (0, ActionUtils_1.getStringInput)('TAG', { required: false });
1226412162
console.info('[awaitStagingDeploys] run() tag', tag);
1226512163
let currentStagingDeploys = [];
1226612164
console.info('[awaitStagingDeploys] run() _.throttle', throttle_1.default);
@@ -12304,6 +12202,68 @@ if (require.main === require.cache[eval('__filename')]) {
1230412202
exports["default"] = run;
1230512203

1230612204

12205+
/***/ }),
12206+
12207+
/***/ 6981:
12208+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
12209+
12210+
"use strict";
12211+
12212+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12213+
if (k2 === undefined) k2 = k;
12214+
var desc = Object.getOwnPropertyDescriptor(m, k);
12215+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12216+
desc = { enumerable: true, get: function() { return m[k]; } };
12217+
}
12218+
Object.defineProperty(o, k2, desc);
12219+
}) : (function(o, m, k, k2) {
12220+
if (k2 === undefined) k2 = k;
12221+
o[k2] = m[k];
12222+
}));
12223+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
12224+
Object.defineProperty(o, "default", { enumerable: true, value: v });
12225+
}) : function(o, v) {
12226+
o["default"] = v;
12227+
});
12228+
var __importStar = (this && this.__importStar) || function (mod) {
12229+
if (mod && mod.__esModule) return mod;
12230+
var result = {};
12231+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
12232+
__setModuleDefault(result, mod);
12233+
return result;
12234+
};
12235+
Object.defineProperty(exports, "__esModule", ({ value: true }));
12236+
exports.getStringInput = exports.getJSONInput = void 0;
12237+
const core = __importStar(__nccwpck_require__(2186));
12238+
/**
12239+
* Safely parse a JSON input to a GitHub Action.
12240+
*
12241+
* @param name - The name of the input.
12242+
* @param options - Options to pass to core.getInput
12243+
* @param [defaultValue] - A default value to provide for the input.
12244+
* Not required if the {required: true} option is given in the second arg to this function.
12245+
*/
12246+
function getJSONInput(name, options, defaultValue) {
12247+
const input = core.getInput(name, options);
12248+
if (input) {
12249+
return JSON.parse(input);
12250+
}
12251+
return defaultValue;
12252+
}
12253+
exports.getJSONInput = getJSONInput;
12254+
/**
12255+
* Safely access a string input to a GitHub Action, or fall back on a default if the string is empty.
12256+
*/
12257+
function getStringInput(name, options, defaultValue) {
12258+
const input = core.getInput(name, options);
12259+
if (!input) {
12260+
return defaultValue;
12261+
}
12262+
return input;
12263+
}
12264+
exports.getStringInput = getStringInput;
12265+
12266+
1230712267
/***/ }),
1230812268

1230912269
/***/ 9873:
@@ -12312,9 +12272,12 @@ exports["default"] = run;
1231212272
"use strict";
1231312273

1231412274
Object.defineProperty(exports, "__esModule", ({ value: true }));
12315-
const CONST = {
12275+
const GIT_CONST = {
1231612276
GITHUB_OWNER: 'Expensify',
1231712277
APP_REPO: 'App',
12278+
};
12279+
const CONST = {
12280+
...GIT_CONST,
1231812281
APPLAUSE_BOT: 'applausebot',
1231912282
OS_BOTIFY: 'OSBotify',
1232012283
LABELS: {
@@ -12323,11 +12286,9 @@ const CONST = {
1232312286
INTERNAL_QA: 'InternalQA',
1232412287
},
1232512288
DATE_FORMAT_STRING: 'yyyy-MM-dd',
12326-
APP_REPO_URL: '',
12327-
APP_REPO_GIT_URL: '',
12289+
APP_REPO_URL: `https://github.com/${GIT_CONST.GITHUB_OWNER}/${GIT_CONST.APP_REPO}`,
12290+
APP_REPO_GIT_URL: `[email protected]:${GIT_CONST.GITHUB_OWNER}/${GIT_CONST.APP_REPO}.git`,
1232812291
};
12329-
CONST.APP_REPO_URL = `https://github.com/${CONST.GITHUB_OWNER}/${CONST.APP_REPO}`;
12330-
CONST.APP_REPO_GIT_URL = `[email protected]:${CONST.GITHUB_OWNER}/${CONST.APP_REPO}.git`;
1233112292
exports["default"] = CONST;
1233212293

1233312294

@@ -12784,6 +12745,53 @@ exports["default"] = GithubUtils;
1278412745
module.exports = GithubUtils;
1278512746

1278612747

12748+
/***/ }),
12749+
12750+
/***/ 9438:
12751+
/***/ ((__unused_webpack_module, exports) => {
12752+
12753+
"use strict";
12754+
12755+
Object.defineProperty(exports, "__esModule", ({ value: true }));
12756+
exports.promiseDoWhile = exports.promiseWhile = void 0;
12757+
/**
12758+
* Simulates a while loop where the condition is determined by the result of a Promise.
12759+
*/
12760+
function promiseWhile(condition, action) {
12761+
console.info('[promiseWhile] promiseWhile()');
12762+
return new Promise((resolve, reject) => {
12763+
const loop = function () {
12764+
if (!condition()) {
12765+
resolve();
12766+
}
12767+
else {
12768+
const actionResult = action?.();
12769+
console.info('[promiseWhile] promiseWhile() actionResult', actionResult);
12770+
Promise.resolve(actionResult).then(loop).catch(reject);
12771+
}
12772+
};
12773+
loop();
12774+
});
12775+
}
12776+
exports.promiseWhile = promiseWhile;
12777+
/**
12778+
* Simulates a do-while loop where the condition is determined by the result of a Promise.
12779+
*/
12780+
function promiseDoWhile(condition, action) {
12781+
console.info('[promiseWhile] promiseDoWhile()');
12782+
return new Promise((resolve, reject) => {
12783+
console.info('[promiseWhile] promiseDoWhile() condition', condition);
12784+
const actionResult = action?.();
12785+
console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);
12786+
actionResult
12787+
?.then(() => promiseWhile(condition, action))
12788+
.then(() => resolve())
12789+
.catch(reject);
12790+
});
12791+
}
12792+
exports.promiseDoWhile = promiseDoWhile;
12793+
12794+
1278712795
/***/ }),
1278812796

1278912797
/***/ 8227:

0 commit comments

Comments
 (0)