This commit is contained in:
GrantBirki 2023-11-07 16:15:14 -07:00
Родитель 6c193bb22a
Коммит 3046b44217
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 9029BBCCC15C6F8C
7 изменённых файлов: 90 добавлений и 90 удалений

30
dist/index.js сгенерированный поставляемый
Просмотреть файл

@ -33952,7 +33952,7 @@ function getUserAgent() {
return navigator.userAgent; return navigator.userAgent;
} }
if (typeof process === "object" && "version" in process) { if (typeof process === "object" && process.version !== undefined) {
return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
} }
@ -36982,7 +36982,7 @@ class GitHubProvider {
owner: github.context.repo.owner, owner: github.context.repo.owner,
repo: github.context.repo.repo, repo: github.context.repo.repo,
issue_number: prNumber, issue_number: prNumber,
} },
); );
return prLabels; return prLabels;
} }
@ -37013,7 +37013,7 @@ class PrivilegedRequester {
this.requesters = this.configContents["requesters"]; this.requesters = this.configContents["requesters"];
} catch (err) { } catch (err) {
lib_core.error( lib_core.error(
`There was a problem with the privileged requester configuration.\n${err}\n${err.stack}` `There was a problem with the privileged requester configuration.\n${err}\n${err.stack}`,
); );
lib_core.setFailed(err.message); lib_core.setFailed(err.message);
return false; return false;
@ -37087,27 +37087,27 @@ class Runner {
async processCommits(privileged_requester_username) { async processCommits(privileged_requester_username) {
// Check all commits of the PR to verify that they are all from the privileged requester, otherwise return from the check // Check all commits of the PR to verify that they are all from the privileged requester, otherwise return from the check
lib_core.info( lib_core.info(
`Commits: Comparing the PR commits to verify that they are all from ${privileged_requester_username}` `Commits: Comparing the PR commits to verify that they are all from ${privileged_requester_username}`,
); );
for (const [, commit] of Object.entries(this.pullRequest.listCommits())) { for (const [, commit] of Object.entries(this.pullRequest.listCommits())) {
let commitAuthor = commit.author.login.toLowerCase(); let commitAuthor = commit.author.login.toLowerCase();
if (commitAuthor !== privileged_requester_username) { if (commitAuthor !== privileged_requester_username) {
lib_core.warning( lib_core.warning(
`Unexpected commit author found by ${commitAuthor}! Commits should be authored by ${privileged_requester_username} I will not proceed with the privileged reviewer process.` `Unexpected commit author found by ${commitAuthor}! Commits should be authored by ${privileged_requester_username} I will not proceed with the privileged reviewer process.`,
); );
return false; return false;
} }
} }
lib_core.info( lib_core.info(
`Commits: All commits are made by ${privileged_requester_username}. Success!` `Commits: All commits are made by ${privileged_requester_username}. Success!`,
); );
return true; return true;
} }
async processDiff() { async processDiff() {
lib_core.info( lib_core.info(
`Diff: Checking the access diff to verify that there are only removals` `Diff: Checking the access diff to verify that there are only removals`,
); );
let diff = await this.pullRequest.getDiff(); let diff = await this.pullRequest.getDiff();
let diffArray = diff.split("\n"); let diffArray = diff.split("\n");
@ -37118,7 +37118,7 @@ class Runner {
} }
if (diffLine.startsWith("+")) { if (diffLine.startsWith("+")) {
lib_core.warning( lib_core.warning(
`Diff: This PR includes additions which are not allowed with the checkDiff option` `Diff: This PR includes additions which are not allowed with the checkDiff option`,
); );
return false; return false;
} }
@ -37155,19 +37155,19 @@ class Runner {
} }
lib_core.info( lib_core.info(
`Labels: Comparing the PR Labels: ${prLabelArray} with the privileged requester labels: ${privileged_requester_config.labels}` `Labels: Comparing the PR Labels: ${prLabelArray} with the privileged requester labels: ${privileged_requester_config.labels}`,
); );
if ( if (
this.labelsEqual(prLabelArray, privileged_requester_config.labels) === this.labelsEqual(prLabelArray, privileged_requester_config.labels) ===
false false
) { ) {
lib_core.warning( lib_core.warning(
`Labels: Invalid label(s) found. I will not proceed with the privileged reviewer process.` `Labels: Invalid label(s) found. I will not proceed with the privileged reviewer process.`,
); );
return false; return false;
} }
lib_core.info( lib_core.info(
`Labels: Labels on the PR match those in the privileged reviewer config. Success!` `Labels: Labels on the PR match those in the privileged reviewer config. Success!`,
); );
return true; return true;
} }
@ -37185,24 +37185,24 @@ class Runner {
// If privileged_requester_username is not the creator of the PR, move on // If privileged_requester_username is not the creator of the PR, move on
// If privileged_requester_username is the creator of the PR, check the remaining config // If privileged_requester_username is the creator of the PR, check the remaining config
lib_core.info( lib_core.info(
`PR creator is ${this.pullRequest.prCreator}. Testing against ${privileged_requester_username}` `PR creator is ${this.pullRequest.prCreator}. Testing against ${privileged_requester_username}`,
); );
if (this.pullRequest.prCreator !== privileged_requester_username) { if (this.pullRequest.prCreator !== privileged_requester_username) {
continue; continue;
} }
await this.processPrivilegedReviewer( await this.processPrivilegedReviewer(
privileged_requester_username, privileged_requester_username,
privileged_requester_config privileged_requester_config,
); );
} }
} }
async processPrivilegedReviewer( async processPrivilegedReviewer(
privileged_requester_username, privileged_requester_username,
privileged_requester_config privileged_requester_config,
) { ) {
lib_core.info( lib_core.info(
`Privileged requester ${privileged_requester_username} found. Checking PR criteria against the privileged requester configuration.` `Privileged requester ${privileged_requester_username} found. Checking PR criteria against the privileged requester configuration.`,
); );
this.checkCommits = lib_core.getInput("checkCommits"); this.checkCommits = lib_core.getInput("checkCommits");

2
dist/index.js.map сгенерированный поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

106
package-lock.json сгенерированный
Просмотреть файл

@ -14,13 +14,13 @@
"js-yaml": "^4.1.0" "js-yaml": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/plugin-proposal-throw-expressions": "^7.18.6", "@babel/plugin-proposal-throw-expressions": "^7.22.5",
"@babel/plugin-transform-modules-commonjs": "^7.18.6", "@babel/plugin-transform-modules-commonjs": "^7.23.0",
"@vercel/ncc": "^0.38.0", "@vercel/ncc": "^0.38.1",
"eslint": "^8.25.0", "eslint": "^8.53.0",
"jest": "^29.2.0", "jest": "^29.7.0",
"nock": "^13.2.9", "nock": "^13.3.8",
"prettier": "^2.7.1" "prettier": "^3.0.3"
} }
}, },
"node_modules/@aashutoshrathi/word-wrap": { "node_modules/@aashutoshrathi/word-wrap": {
@ -627,9 +627,9 @@
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "2.1.2", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz",
"integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
@ -677,9 +677,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "8.51.0", "version": "8.53.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz",
"integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -694,12 +694,12 @@
} }
}, },
"node_modules/@humanwhocodes/config-array": { "node_modules/@humanwhocodes/config-array": {
"version": "0.11.11", "version": "0.11.13",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz",
"integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@humanwhocodes/object-schema": "^1.2.1", "@humanwhocodes/object-schema": "^2.0.1",
"debug": "^4.1.1", "debug": "^4.1.1",
"minimatch": "^3.0.5" "minimatch": "^3.0.5"
}, },
@ -721,9 +721,9 @@
} }
}, },
"node_modules/@humanwhocodes/object-schema": { "node_modules/@humanwhocodes/object-schema": {
"version": "1.2.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz",
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==",
"dev": true "dev": true
}, },
"node_modules/@istanbuljs/load-nyc-config": { "node_modules/@istanbuljs/load-nyc-config": {
@ -1774,19 +1774,25 @@
"integrity": "sha512-axdPBuLuEJt0c4yI5OZssC19K2Mq1uKdrfZBzuxLvaztgqUtFYZUNw7lETExPYJR9jdEoIg4mb7RQKRQzOkeGQ==", "integrity": "sha512-axdPBuLuEJt0c4yI5OZssC19K2Mq1uKdrfZBzuxLvaztgqUtFYZUNw7lETExPYJR9jdEoIg4mb7RQKRQzOkeGQ==",
"dev": true "dev": true
}, },
"node_modules/@ungap/structured-clone": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
"integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
"dev": true
},
"node_modules/@vercel/ncc": { "node_modules/@vercel/ncc": {
"version": "0.38.0", "version": "0.38.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.0.tgz", "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz",
"integrity": "sha512-B4YKZMm/EqMptKSFyAq4q2SlgJe+VCmEH6Y8gf/E1pTlWbsUJpuH1ymik2Ex3aYO5mCWwV1kaSYHSQOT8+4vHA==", "integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==",
"dev": true, "dev": true,
"bin": { "bin": {
"ncc": "dist/ncc/cli.js" "ncc": "dist/ncc/cli.js"
} }
}, },
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.10.0", "version": "8.11.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
"integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
"dev": true, "dev": true,
"bin": { "bin": {
"acorn": "bin/acorn" "acorn": "bin/acorn"
@ -2508,18 +2514,19 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "8.51.0", "version": "8.53.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz",
"integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1", "@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.2", "@eslint/eslintrc": "^2.1.3",
"@eslint/js": "8.51.0", "@eslint/js": "8.53.0",
"@humanwhocodes/config-array": "^0.11.11", "@humanwhocodes/config-array": "^0.11.13",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
"@ungap/structured-clone": "^1.2.0",
"ajv": "^6.12.4", "ajv": "^6.12.4",
"chalk": "^4.0.0", "chalk": "^4.0.0",
"cross-spawn": "^7.0.2", "cross-spawn": "^7.0.2",
@ -5058,12 +5065,6 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"node_modules/lodash.merge": { "node_modules/lodash.merge": {
"version": "4.6.2", "version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@ -5189,14 +5190,13 @@
"dev": true "dev": true
}, },
"node_modules/nock": { "node_modules/nock": {
"version": "13.3.4", "version": "13.3.8",
"resolved": "https://registry.npmjs.org/nock/-/nock-13.3.4.tgz", "resolved": "https://registry.npmjs.org/nock/-/nock-13.3.8.tgz",
"integrity": "sha512-DDpmn5oLEdCTclEqweOT4U7bEpuoifBMFUXem9sA4turDAZ5tlbrEoWqCorwXey8CaAw44mst5JOQeVNiwtkhw==", "integrity": "sha512-96yVFal0c/W1lG7mmfRe7eO+hovrhJYd2obzzOZ90f6fjpeU/XNvd9cYHZKZAQJumDfhXgoTpkpJ9pvMj+hqHw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"debug": "^4.1.0", "debug": "^4.1.0",
"json-stringify-safe": "^5.0.1", "json-stringify-safe": "^5.0.1",
"lodash": "^4.17.21",
"propagate": "^2.0.0" "propagate": "^2.0.0"
}, },
"engines": { "engines": {
@ -5498,15 +5498,15 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.8.8", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin/prettier.cjs"
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=14"
}, },
"funding": { "funding": {
"url": "https://github.com/prettier/prettier?sponsor=1" "url": "https://github.com/prettier/prettier?sponsor=1"
@ -5561,9 +5561,9 @@
} }
}, },
"node_modules/punycode": { "node_modules/punycode": {
"version": "2.3.0", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6" "node": ">=6"
@ -6025,9 +6025,9 @@
"dev": true "dev": true
}, },
"node_modules/universal-user-agent": { "node_modules/universal-user-agent": {
"version": "6.0.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz",
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="
}, },
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
"version": "1.0.13", "version": "1.0.13",

Просмотреть файл

@ -35,12 +35,12 @@
"js-yaml": "^4.1.0" "js-yaml": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/plugin-proposal-throw-expressions": "^7.18.6", "@babel/plugin-proposal-throw-expressions": "^7.22.5",
"@babel/plugin-transform-modules-commonjs": "^7.18.6", "@babel/plugin-transform-modules-commonjs": "^7.23.0",
"@vercel/ncc": "^0.38.0", "@vercel/ncc": "^0.38.1",
"eslint": "^8.25.0", "eslint": "^8.53.0",
"jest": "^29.2.0", "jest": "^29.7.0",
"nock": "^13.2.9", "nock": "^13.3.8",
"prettier": "^2.7.1" "prettier": "^3.0.3"
} }
} }

Просмотреть файл

@ -63,7 +63,7 @@ class GitHubProvider {
owner: github.context.repo.owner, owner: github.context.repo.owner,
repo: github.context.repo.repo, repo: github.context.repo.repo,
issue_number: prNumber, issue_number: prNumber,
} },
); );
return prLabels; return prLabels;
} }

Просмотреть файл

@ -20,7 +20,7 @@ class PrivilegedRequester {
this.requesters = this.configContents["requesters"]; this.requesters = this.configContents["requesters"];
} catch (err) { } catch (err) {
core.error( core.error(
`There was a problem with the privileged requester configuration.\n${err}\n${err.stack}` `There was a problem with the privileged requester configuration.\n${err}\n${err.stack}`,
); );
core.setFailed(err.message); core.setFailed(err.message);
return false; return false;

Просмотреть файл

@ -11,27 +11,27 @@ class Runner {
async processCommits(privileged_requester_username) { async processCommits(privileged_requester_username) {
// Check all commits of the PR to verify that they are all from the privileged requester, otherwise return from the check // Check all commits of the PR to verify that they are all from the privileged requester, otherwise return from the check
core.info( core.info(
`Commits: Comparing the PR commits to verify that they are all from ${privileged_requester_username}` `Commits: Comparing the PR commits to verify that they are all from ${privileged_requester_username}`,
); );
for (const [, commit] of Object.entries(this.pullRequest.listCommits())) { for (const [, commit] of Object.entries(this.pullRequest.listCommits())) {
let commitAuthor = commit.author.login.toLowerCase(); let commitAuthor = commit.author.login.toLowerCase();
if (commitAuthor !== privileged_requester_username) { if (commitAuthor !== privileged_requester_username) {
core.warning( core.warning(
`Unexpected commit author found by ${commitAuthor}! Commits should be authored by ${privileged_requester_username} I will not proceed with the privileged reviewer process.` `Unexpected commit author found by ${commitAuthor}! Commits should be authored by ${privileged_requester_username} I will not proceed with the privileged reviewer process.`,
); );
return false; return false;
} }
} }
core.info( core.info(
`Commits: All commits are made by ${privileged_requester_username}. Success!` `Commits: All commits are made by ${privileged_requester_username}. Success!`,
); );
return true; return true;
} }
async processDiff() { async processDiff() {
core.info( core.info(
`Diff: Checking the access diff to verify that there are only removals` `Diff: Checking the access diff to verify that there are only removals`,
); );
let diff = await this.pullRequest.getDiff(); let diff = await this.pullRequest.getDiff();
let diffArray = diff.split("\n"); let diffArray = diff.split("\n");
@ -42,7 +42,7 @@ class Runner {
} }
if (diffLine.startsWith("+")) { if (diffLine.startsWith("+")) {
core.warning( core.warning(
`Diff: This PR includes additions which are not allowed with the checkDiff option` `Diff: This PR includes additions which are not allowed with the checkDiff option`,
); );
return false; return false;
} }
@ -79,19 +79,19 @@ class Runner {
} }
core.info( core.info(
`Labels: Comparing the PR Labels: ${prLabelArray} with the privileged requester labels: ${privileged_requester_config.labels}` `Labels: Comparing the PR Labels: ${prLabelArray} with the privileged requester labels: ${privileged_requester_config.labels}`,
); );
if ( if (
this.labelsEqual(prLabelArray, privileged_requester_config.labels) === this.labelsEqual(prLabelArray, privileged_requester_config.labels) ===
false false
) { ) {
core.warning( core.warning(
`Labels: Invalid label(s) found. I will not proceed with the privileged reviewer process.` `Labels: Invalid label(s) found. I will not proceed with the privileged reviewer process.`,
); );
return false; return false;
} }
core.info( core.info(
`Labels: Labels on the PR match those in the privileged reviewer config. Success!` `Labels: Labels on the PR match those in the privileged reviewer config. Success!`,
); );
return true; return true;
} }
@ -109,24 +109,24 @@ class Runner {
// If privileged_requester_username is not the creator of the PR, move on // If privileged_requester_username is not the creator of the PR, move on
// If privileged_requester_username is the creator of the PR, check the remaining config // If privileged_requester_username is the creator of the PR, check the remaining config
core.info( core.info(
`PR creator is ${this.pullRequest.prCreator}. Testing against ${privileged_requester_username}` `PR creator is ${this.pullRequest.prCreator}. Testing against ${privileged_requester_username}`,
); );
if (this.pullRequest.prCreator !== privileged_requester_username) { if (this.pullRequest.prCreator !== privileged_requester_username) {
continue; continue;
} }
await this.processPrivilegedReviewer( await this.processPrivilegedReviewer(
privileged_requester_username, privileged_requester_username,
privileged_requester_config privileged_requester_config,
); );
} }
} }
async processPrivilegedReviewer( async processPrivilegedReviewer(
privileged_requester_username, privileged_requester_username,
privileged_requester_config privileged_requester_config,
) { ) {
core.info( core.info(
`Privileged requester ${privileged_requester_username} found. Checking PR criteria against the privileged requester configuration.` `Privileged requester ${privileged_requester_username} found. Checking PR criteria against the privileged requester configuration.`,
); );
this.checkCommits = core.getInput("checkCommits"); this.checkCommits = core.getInput("checkCommits");