Update naming

This commit is contained in:
Nikolai Laevskii
2023-09-25 15:28:47 +02:00
parent c40a0983dc
commit 27ee87f076
3 changed files with 12 additions and 12 deletions

15
dist/index.js vendored
View File

@@ -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]); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getChangedPullRequests = void 0; exports.getPullRequests = void 0;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438)); const github = __importStar(__nccwpck_require__(5438));
const get_changed_files_1 = __nccwpck_require__(8622); const get_changed_files_1 = __nccwpck_require__(8622);
function getChangedPullRequests(client, prNumbers) { function getPullRequests(client, prNumbers) {
return __asyncGenerator(this, arguments, function* getChangedPullRequests_1() { return __asyncGenerator(this, arguments, function* getPullRequests_1() {
for (const prNumber of prNumbers) { for (const prNumber of prNumbers) {
core.debug(`looking for pr #${prNumber}`); core.debug(`looking for pr #${prNumber}`);
let prData; let prData;
@@ -137,7 +137,7 @@ function getChangedPullRequests(client, prNumbers) {
} }
}); });
} }
exports.getChangedPullRequests = getChangedPullRequests; exports.getPullRequests = getPullRequests;
/***/ }), /***/ }),
@@ -561,9 +561,10 @@ function labeler() {
return; return;
} }
const client = github.getOctokit(token, {}, pluginRetry.retry); const client = github.getOctokit(token, {}, pluginRetry.retry);
const pullRequests = api.getPullRequests(client, prNumbers);
try { try {
for (var _d = true, _e = __asyncValues(api.getChangedPullRequests(client, prNumbers)), _f; _f = yield _e.next(), _a = _f.done, !_a;) { 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 = _f.value; _c = pullRequests_1_1.value;
_d = false; _d = false;
try { try {
const pullRequest = _c; const pullRequest = _c;
@@ -613,7 +614,7 @@ function labeler() {
catch (e_1_1) { e_1 = { error: e_1_1 }; } catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally { finally {
try { 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; } finally { if (e_1) throw e_1.error; }
} }

View File

@@ -3,7 +3,7 @@ import * as github from '@actions/github';
import {getChangedFiles} from './get-changed-files'; import {getChangedFiles} from './get-changed-files';
import {ClientType} from './types'; import {ClientType} from './types';
export async function* getChangedPullRequests( export async function* getPullRequests(
client: ClientType, client: ClientType,
prNumbers: number[] prNumbers: number[]
) { ) {

View File

@@ -33,10 +33,9 @@ async function labeler() {
const client: ClientType = github.getOctokit(token, {}, pluginRetry.retry); const client: ClientType = github.getOctokit(token, {}, pluginRetry.retry);
for await (const pullRequest of api.getChangedPullRequests( const pullRequests = api.getPullRequests(client, prNumbers);
client,
prNumbers for await (const pullRequest of pullRequests) {
)) {
const labelGlobs: Map<string, StringOrMatchConfig[]> = const labelGlobs: Map<string, StringOrMatchConfig[]> =
await api.getLabelGlobs(client, configPath); await api.getLabelGlobs(client, configPath);
const preexistingLabels = pullRequest.data.labels.map(l => l.name); const preexistingLabels = pullRequest.data.labels.map(l => l.name);