@@ -12131,15 +12131,8 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
12131
12131
const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
12132
12132
const promiseWhile_1 = __nccwpck_require__(9438);
12133
12133
function run() {
12134
- console.info('[awaitStagingDeploys] POLL RATE', CONST_1.default.POLL_RATE);
12135
- console.info('[awaitStagingDeploys] run()');
12136
- console.info('[awaitStagingDeploys] getStringInput', ActionUtils_1.getStringInput);
12137
- console.info('[awaitStagingDeploys] GitHubUtils', GithubUtils_1.default);
12138
- console.info('[awaitStagingDeploys] promiseDoWhile', promiseWhile_1.promiseDoWhile);
12139
12134
const tag = (0, ActionUtils_1.getStringInput)('TAG', { required: false });
12140
- console.info('[awaitStagingDeploys] run() tag', tag);
12141
12135
let currentStagingDeploys = [];
12142
- console.info('[awaitStagingDeploys] run() _.throttle', throttle_1.default);
12143
12136
const throttleFunc = () => Promise.all([
12144
12137
// These are active deploys
12145
12138
GithubUtils_1.default.octokit.actions.listWorkflowRuns({
@@ -12159,22 +12152,18 @@ function run() {
12159
12152
}),
12160
12153
])
12161
12154
.then((responses) => {
12162
- console.info('[awaitStagingDeploys] listWorkflowRuns responses', responses);
12163
12155
const workflowRuns = responses[0].data.workflow_runs;
12164
12156
if (!tag && typeof responses[1] === 'object') {
12165
12157
workflowRuns.push(...responses[1].data.workflow_runs);
12166
12158
}
12167
- console.info('[awaitStagingDeploys] workflowRuns', workflowRuns);
12168
12159
return workflowRuns;
12169
12160
})
12170
12161
.then((workflowRuns) => (currentStagingDeploys = workflowRuns.filter((workflowRun) => workflowRun.status !== 'completed')))
12171
12162
.then(() => {
12172
- console.info('[awaitStagingDeploys] currentStagingDeploys', currentStagingDeploys);
12173
12163
console.log(!currentStagingDeploys.length
12174
12164
? 'No current staging deploys found'
12175
12165
: `Found ${currentStagingDeploys.length} staging deploy${currentStagingDeploys.length > 1 ? 's' : ''} still running...`);
12176
12166
});
12177
- console.info('[awaitStagingDeploys] run() throttleFunc', throttleFunc);
12178
12167
return (0, promiseWhile_1.promiseDoWhile)(() => !!currentStagingDeploys.length, (0, throttle_1.default)(throttleFunc,
12179
12168
// Poll every 60 seconds instead of every 10 seconds
12180
12169
CONST_1.default.POLL_RATE * 6));
@@ -12730,15 +12719,13 @@ exports.promiseDoWhile = exports.promiseWhile = void 0;
12730
12719
* Simulates a while loop where the condition is determined by the result of a Promise.
12731
12720
*/
12732
12721
function promiseWhile(condition, action) {
12733
- console.info('[promiseWhile] promiseWhile()');
12734
12722
return new Promise((resolve, reject) => {
12735
12723
const loop = function () {
12736
12724
if (!condition()) {
12737
12725
resolve();
12738
12726
}
12739
12727
else {
12740
12728
const actionResult = action?.();
12741
- console.info('[promiseWhile] promiseWhile() actionResult', actionResult);
12742
12729
if (!actionResult) {
12743
12730
resolve();
12744
12731
return;
@@ -12759,11 +12746,8 @@ exports.promiseWhile = promiseWhile;
12759
12746
* Simulates a do-while loop where the condition is determined by the result of a Promise.
12760
12747
*/
12761
12748
function promiseDoWhile(condition, action) {
12762
- console.info('[promiseWhile] promiseDoWhile()');
12763
12749
return new Promise((resolve, reject) => {
12764
- console.info('[promiseWhile] promiseDoWhile() condition', condition);
12765
12750
const actionResult = action?.();
12766
- console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult);
12767
12751
if (!actionResult) {
12768
12752
resolve();
12769
12753
return;
0 commit comments