From 27ee87f076c307587cc9553e9932b4411dbd52b6 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Mon, 25 Sep 2023 15:28:47 +0200 Subject: [PATCH] Update naming --- dist/index.js | 15 ++++++++------- src/api/get-changed-pull-requests.ts | 2 +- src/labeler.ts | 7 +++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index ca66e066..f501b037 100644 --- a/dist/index.js +++ b/dist/index.js @@ -102,12 +102,12 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getChangedPullRequests = void 0; +exports.getPullRequests = void 0; const core = __importStar(__nccwpck_require__(2186)); const github = __importStar(__nccwpck_require__(5438)); const get_changed_files_1 = __nccwpck_require__(8622); -function getChangedPullRequests(client, prNumbers) { - return __asyncGenerator(this, arguments, function* getChangedPullRequests_1() { +function getPullRequests(client, prNumbers) { + return __asyncGenerator(this, arguments, function* getPullRequests_1() { for (const prNumber of prNumbers) { core.debug(`looking for pr #${prNumber}`); let prData; @@ -137,7 +137,7 @@ function getChangedPullRequests(client, prNumbers) { } }); } -exports.getChangedPullRequests = getChangedPullRequests; +exports.getPullRequests = getPullRequests; /***/ }), @@ -561,9 +561,10 @@ function labeler() { return; } const client = github.getOctokit(token, {}, pluginRetry.retry); + const pullRequests = api.getPullRequests(client, prNumbers); try { - for (var _d = true, _e = __asyncValues(api.getChangedPullRequests(client, prNumbers)), _f; _f = yield _e.next(), _a = _f.done, !_a;) { - _c = _f.value; + for (var _d = true, pullRequests_1 = __asyncValues(pullRequests), pullRequests_1_1; pullRequests_1_1 = yield pullRequests_1.next(), _a = pullRequests_1_1.done, !_a;) { + _c = pullRequests_1_1.value; _d = false; try { const pullRequest = _c; @@ -613,7 +614,7 @@ function labeler() { catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { - if (!_d && !_a && (_b = _e.return)) yield _b.call(_e); + if (!_d && !_a && (_b = pullRequests_1.return)) yield _b.call(pullRequests_1); } finally { if (e_1) throw e_1.error; } } diff --git a/src/api/get-changed-pull-requests.ts b/src/api/get-changed-pull-requests.ts index 0dd3eec1..f8383891 100644 --- a/src/api/get-changed-pull-requests.ts +++ b/src/api/get-changed-pull-requests.ts @@ -3,7 +3,7 @@ import * as github from '@actions/github'; import {getChangedFiles} from './get-changed-files'; import {ClientType} from './types'; -export async function* getChangedPullRequests( +export async function* getPullRequests( client: ClientType, prNumbers: number[] ) { diff --git a/src/labeler.ts b/src/labeler.ts index 4988ccf7..46f87142 100644 --- a/src/labeler.ts +++ b/src/labeler.ts @@ -33,10 +33,9 @@ async function labeler() { const client: ClientType = github.getOctokit(token, {}, pluginRetry.retry); - for await (const pullRequest of api.getChangedPullRequests( - client, - prNumbers - )) { + const pullRequests = api.getPullRequests(client, prNumbers); + + for await (const pullRequest of pullRequests) { const labelGlobs: Map = await api.getLabelGlobs(client, configPath); const preexistingLabels = pullRequest.data.labels.map(l => l.name);