From 86bad267b68324dea72b54ffabf20ad6269fd47d Mon Sep 17 00:00:00 2001 From: Alan Ryan <20208488+Alan-Ryan@users.noreply.github.com> Date: Wed, 11 Mar 2026 19:05:51 +0000 Subject: [PATCH 1/3] ci: add Node 24 to test matrix, drop EOL Node 18, bump setup-node to v4 --- .github/workflows/nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 519beca9..e9f0c09e 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -18,12 +18,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x, 20.x] + node-version: [20.x, 24.x] steps: - name: "Checkout repository" uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Npm install From 17d233d3e227baaafe36d538f70a695732c46a17 Mon Sep 17 00:00:00 2001 From: Alan Ryan <20208488+Alan-Ryan@users.noreply.github.com> Date: Wed, 11 Mar 2026 19:41:06 +0000 Subject: [PATCH 2/3] build: upgrade action runtime to node 24 --- action.yml | 2 +- dist/index.js | 1163 ++++++++++++++++++++++----------------------- package-lock.json | 143 ++++-- package.json | 6 +- tsconfig.json | 3 +- 5 files changed, 679 insertions(+), 638 deletions(-) diff --git a/action.yml b/action.yml index 5594200f..8c69f4aa 100644 --- a/action.yml +++ b/action.yml @@ -52,5 +52,5 @@ inputs: default: "" deprecationMessage: "The status-context input is deprecated and no longer used. The action now uses GitHub Actions Check Runs which provide better feedback through job summaries and annotations. Please remove this input from your workflow." runs: - using: "node20" + using: "node24" main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 84cde4de..01d44517 100644 --- a/dist/index.js +++ b/dist/index.js @@ -22,24 +22,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.checkAllowList = void 0; +exports.checkAllowList = checkAllowList; const _ = __importStar(__nccwpck_require__(2356)); const input = __importStar(__nccwpck_require__(7189)); const persistence_1 = __nccwpck_require__(9947); @@ -64,59 +65,47 @@ function isUserNotInAllowList(committer, usernameAllowListPatterns, domainAllowL return pattern === committer.name; }).length > 0; } -function checkAllowList(committers) { - return __awaiter(this, void 0, void 0, function* () { - // Load allowlists at runtime (not module-load time) for testability - const usernameAllowListPatterns = input.getUsernameAllowList().split(','); - const domainAllowList = input.getDomainAllowList().split(','); - const domainsFile = input.getDomainsFile(); - if (domainsFile) { - try { - const result = yield (0, persistence_1.getFileContent)(domainsFile); - const jsonData = Buffer.from(result.data.content, 'base64').toString(); - let domainsFileContent = JSON.parse(jsonData); - if (domainsFileContent && Array.isArray(domainsFileContent)) { - domainAllowList.push(...domainsFileContent); - } +async function checkAllowList(committers) { + // Load allowlists at runtime (not module-load time) for testability + const usernameAllowListPatterns = input.getUsernameAllowList().split(','); + const domainAllowList = input.getDomainAllowList().split(','); + const domainsFile = input.getDomainsFile(); + if (domainsFile) { + try { + const result = await (0, persistence_1.getFileContent)(domainsFile); + const jsonData = Buffer.from(result.data.content, 'base64').toString(); + let domainsFileContent = JSON.parse(jsonData); + if (domainsFileContent && Array.isArray(domainsFileContent)) { + domainAllowList.push(...domainsFileContent); } - catch (error) { - if (error.status != "404") { - throw new Error(`Could not retrieve whitelisted email domains. Status: ${error.status || 'unknown'}`); - } + } + catch (error) { + if (error.status != "404") { + throw new Error(`Could not retrieve whitelisted email domains. Status: ${error.status || 'unknown'}`); } } - const committersAfterAllowListCheck = committers.filter(committer => committer && !(isUserNotInAllowList !== undefined && isUserNotInAllowList(committer, usernameAllowListPatterns, domainAllowList))); - return committersAfterAllowListCheck; - }); + } + const committersAfterAllowListCheck = committers.filter(committer => committer && !(isUserNotInAllowList !== undefined && isUserNotInAllowList(committer, usernameAllowListPatterns, domainAllowList))); + return committersAfterAllowListCheck; } -exports.checkAllowList = checkAllowList; /***/ }), /***/ 5777: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports["default"] = getCommitters; const octokit_1 = __nccwpck_require__(5957); const github_1 = __nccwpck_require__(3228); -function getCommitters() { - return __awaiter(this, void 0, void 0, function* () { - try { - let committers = []; - let filteredCommitters = []; - let response = yield octokit_1.octokit.graphql(` +async function getCommitters() { + try { + let committers = []; + let filteredCommitters = []; + let response = await octokit_1.octokit.graphql(` query($owner:String! $name:String! $number:Int! $cursor:String!){ repository(owner: $owner, name: $name) { pullRequest(number: $number) { @@ -154,36 +143,34 @@ function getCommitters() { } } }`.replace(/ /g, ''), { - owner: github_1.context.repo.owner, - name: github_1.context.repo.repo, - number: github_1.context.issue.number, - cursor: '' - }); - response.repository.pullRequest.commits.edges.forEach(edge => { - const committer = extractUserFromCommit(edge.node.commit); - let user = { - name: committer.login || committer.name, - id: committer.databaseId || '', - email: edge.node.commit.author.email || '', - pullRequestNo: github_1.context.issue.number - }; - if (committers.length === 0 || committers.map((c) => { - return c.name; - }).indexOf(user.name) < 0) { - committers.push(user); - } - }); - filteredCommitters = committers.filter((committer) => { - return committer.id !== 41898282; - }); - return filteredCommitters; - } - catch (e) { - throw new Error(`graphql call to get the committers details failed: ${e}`); - } - }); + owner: github_1.context.repo.owner, + name: github_1.context.repo.repo, + number: github_1.context.issue.number, + cursor: '' + }); + response.repository.pullRequest.commits.edges.forEach(edge => { + const committer = extractUserFromCommit(edge.node.commit); + let user = { + name: committer.login || committer.name, + id: committer.databaseId || '', + email: edge.node.commit.author.email || '', + pullRequestNo: github_1.context.issue.number + }; + if (committers.length === 0 || committers.map((c) => { + return c.name; + }).indexOf(user.name) < 0) { + committers.push(user); + } + }); + filteredCommitters = committers.filter((committer) => { + return committer.id !== 41898282; + }); + return filteredCommitters; + } + catch (e) { + throw new Error(`graphql call to get the committers details failed: ${e}`); + } } -exports["default"] = getCommitters; const extractUserFromCommit = (commit) => commit.author.user || commit.committer.user || commit.author || commit.committer; @@ -210,52 +197,50 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.run = void 0; +exports.run = run; const github_1 = __nccwpck_require__(3228); const setupClaCheck_1 = __nccwpck_require__(3715); const pullRequestLock_1 = __nccwpck_require__(6868); const core = __importStar(__nccwpck_require__(7484)); const input = __importStar(__nccwpck_require__(7189)); -function run() { - return __awaiter(this, void 0, void 0, function* () { - try { - core.info(`CLA Assistant GitHub Action bot has started the process`); - /* - * using a `string` true or false purposely as github action input cannot have a boolean value - */ - if (github_1.context.payload.action === 'closed' && - input.lockPullRequestAfterMerge() == 'true') { - return (0, pullRequestLock_1.lockPullRequest)(); - } - else { - yield (0, setupClaCheck_1.setupClaCheck)(); - } +async function run() { + try { + core.info(`CLA Assistant GitHub Action bot has started the process`); + /* + * using a `string` true or false purposely as github action input cannot have a boolean value + */ + if (github_1.context.payload.action === 'closed' && + input.lockPullRequestAfterMerge() == 'true') { + return (0, pullRequestLock_1.lockPullRequest)(); } - catch (error) { - if (error instanceof Error) { - core.setFailed(error.message); - } + else { + await (0, setupClaCheck_1.setupClaCheck)(); } - }); + } + catch (error) { + if (error instanceof Error) { + core.setFailed(error.message); + } + } } -exports.run = run; run(); @@ -282,15 +267,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPersonalAccessTokenPresent = exports.getPATOctokit = exports.getDefaultOctokitClient = exports.octokit = void 0; +exports.octokit = void 0; +exports.getDefaultOctokitClient = getDefaultOctokitClient; +exports.getPATOctokit = getPATOctokit; +exports.isPersonalAccessTokenPresent = isPersonalAccessTokenPresent; const github_1 = __nccwpck_require__(3228); const core = __importStar(__nccwpck_require__(7484)); const githubActionsDefaultToken = process.env.GITHUB_TOKEN; @@ -299,18 +297,15 @@ exports.octokit = (0, github_1.getOctokit)(githubActionsDefaultToken); function getDefaultOctokitClient() { return (0, github_1.getOctokit)(githubActionsDefaultToken); } -exports.getDefaultOctokitClient = getDefaultOctokitClient; function getPATOctokit() { if (!isPersonalAccessTokenPresent()) { core.setFailed(`Please add a personal access token as an environment variable for writing signatures in a remote repository/organization as mentioned in the README.md file`); } return (0, github_1.getOctokit)(personalAccessToken); } -exports.getPATOctokit = getPATOctokit; function isPersonalAccessTokenPresent() { return personalAccessToken !== undefined && personalAccessToken !== ''; } -exports.isPersonalAccessTokenPresent = isPersonalAccessTokenPresent; /***/ }), @@ -336,86 +331,80 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.updateFile = exports.createFile = exports.getFileContent = void 0; +exports.getFileContent = getFileContent; +exports.createFile = createFile; +exports.updateFile = updateFile; const github_1 = __nccwpck_require__(3228); const octokit_1 = __nccwpck_require__(5957); const input = __importStar(__nccwpck_require__(7189)); -function getFileContent(path = input.getPathToSignatures()) { - return __awaiter(this, void 0, void 0, function* () { - const octokitInstance = isRemoteRepoOrOrgConfigured() ? (0, octokit_1.getPATOctokit)() : (0, octokit_1.getDefaultOctokitClient)(); - const result = yield octokitInstance.repos.getContent({ - owner: input.getRemoteOrgName() || github_1.context.repo.owner, - repo: input.getRemoteRepoName() || github_1.context.repo.repo, - path, - ref: input.getBranch() - }); - return result; +async function getFileContent(path = input.getPathToSignatures()) { + const octokitInstance = isRemoteRepoOrOrgConfigured() ? (0, octokit_1.getPATOctokit)() : (0, octokit_1.getDefaultOctokitClient)(); + const result = await octokitInstance.repos.getContent({ + owner: input.getRemoteOrgName() || github_1.context.repo.owner, + repo: input.getRemoteRepoName() || github_1.context.repo.repo, + path, + ref: input.getBranch() }); + return result; } -exports.getFileContent = getFileContent; -function createFile(contentBinary) { - return __awaiter(this, void 0, void 0, function* () { - const octokitInstance = isRemoteRepoOrOrgConfigured() ? (0, octokit_1.getPATOctokit)() : (0, octokit_1.getDefaultOctokitClient)(); - return octokitInstance.repos.createOrUpdateFileContents({ - owner: input.getRemoteOrgName() || github_1.context.repo.owner, - repo: input.getRemoteRepoName() || github_1.context.repo.repo, - path: input.getPathToSignatures(), - message: input.getCreateFileCommitMessage() || - 'Creating file for storing CLA Signatures', - content: contentBinary, - branch: input.getBranch() - }); +async function createFile(contentBinary) { + const octokitInstance = isRemoteRepoOrOrgConfigured() ? (0, octokit_1.getPATOctokit)() : (0, octokit_1.getDefaultOctokitClient)(); + return octokitInstance.repos.createOrUpdateFileContents({ + owner: input.getRemoteOrgName() || github_1.context.repo.owner, + repo: input.getRemoteRepoName() || github_1.context.repo.repo, + path: input.getPathToSignatures(), + message: input.getCreateFileCommitMessage() || + 'Creating file for storing CLA Signatures', + content: contentBinary, + branch: input.getBranch() }); } -exports.createFile = createFile; -function updateFile(sha, claFileContent, reactedCommitters) { - return __awaiter(this, void 0, void 0, function* () { - const octokitInstance = isRemoteRepoOrOrgConfigured() ? (0, octokit_1.getPATOctokit)() : (0, octokit_1.getDefaultOctokitClient)(); - const pullRequestNo = github_1.context.issue.number; - const owner = github_1.context.issue.owner; - const repo = github_1.context.issue.repo; - claFileContent === null || claFileContent === void 0 ? void 0 : claFileContent.signedContributors.push(...reactedCommitters.newSigned); - let contentString = JSON.stringify(claFileContent, null, 2); - let contentBinary = Buffer.from(contentString).toString('base64'); - yield octokitInstance.repos.createOrUpdateFileContents({ - owner: input.getRemoteOrgName() || github_1.context.repo.owner, - repo: input.getRemoteRepoName() || github_1.context.repo.repo, - path: input.getPathToSignatures(), - sha, - message: input.getSignedCommitMessage() - ? input - .getSignedCommitMessage() - .replace('$contributorName', github_1.context.actor) - // .replace('$pullRequestNo', pullRequestNo.toString()) - .replace('$owner', owner) - .replace('$repo', repo) - : `@${github_1.context.actor} has signed the CLA in ${owner}/${repo}#${pullRequestNo}`, - content: contentBinary, - branch: input.getBranch() - }); +async function updateFile(sha, claFileContent, reactedCommitters) { + const octokitInstance = isRemoteRepoOrOrgConfigured() ? (0, octokit_1.getPATOctokit)() : (0, octokit_1.getDefaultOctokitClient)(); + const pullRequestNo = github_1.context.issue.number; + const owner = github_1.context.issue.owner; + const repo = github_1.context.issue.repo; + claFileContent?.signedContributors.push(...reactedCommitters.newSigned); + let contentString = JSON.stringify(claFileContent, null, 2); + let contentBinary = Buffer.from(contentString).toString('base64'); + await octokitInstance.repos.createOrUpdateFileContents({ + owner: input.getRemoteOrgName() || github_1.context.repo.owner, + repo: input.getRemoteRepoName() || github_1.context.repo.repo, + path: input.getPathToSignatures(), + sha, + message: input.getSignedCommitMessage() + ? input + .getSignedCommitMessage() + .replace('$contributorName', github_1.context.actor) + // .replace('$pullRequestNo', pullRequestNo.toString()) + .replace('$owner', owner) + .replace('$repo', repo) + : `@${github_1.context.actor} has signed the CLA in ${owner}/${repo}#${pullRequestNo}`, + content: contentBinary, + branch: input.getBranch() }); } -exports.updateFile = updateFile; function isRemoteRepoOrOrgConfigured() { let isRemoteRepoOrOrgConfigured = false; - if ((input === null || input === void 0 ? void 0 : input.getRemoteRepoName()) || input.getRemoteOrgName()) { + if (input?.getRemoteRepoName() || input.getRemoteOrgName()) { isRemoteRepoOrOrgConfigured = true; return isRemoteRepoOrOrgConfigured; } @@ -446,112 +435,100 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reRunLastWorkFlowIfRequired = void 0; +exports.reRunLastWorkFlowIfRequired = reRunLastWorkFlowIfRequired; const github_1 = __nccwpck_require__(3228); const octokit_1 = __nccwpck_require__(5957); const core = __importStar(__nccwpck_require__(7484)); // Note: why this re-run of the last failed CLA workflow status check is explained this issue https://github.com/cla-assistant/github-action/issues/39 -function reRunLastWorkFlowIfRequired() { - return __awaiter(this, void 0, void 0, function* () { - if (github_1.context.eventName === 'pull_request') { - core.debug(`rerun not required for event - pull_request`); - return; - } - const branch = yield getBranchOfPullRequest(); - const workflowId = yield getSelfWorkflowId(); - const runs = yield listWorkflowRunsInBranch(branch, workflowId); - if (runs.data.total_count > 0) { - const run = runs.data.workflow_runs[0].id; - const isLastWorkFlowFailed = yield checkIfLastWorkFlowFailed(run); - if (isLastWorkFlowFailed) { - core.debug(`Rerunning build run ${run}`); - yield reRunWorkflow(run).catch(error => core.error(`Error occurred when re-running the workflow: ${error}`)); - } +async function reRunLastWorkFlowIfRequired() { + if (github_1.context.eventName === 'pull_request') { + core.debug(`rerun not required for event - pull_request`); + return; + } + const branch = await getBranchOfPullRequest(); + const workflowId = await getSelfWorkflowId(); + const runs = await listWorkflowRunsInBranch(branch, workflowId); + if (runs.data.total_count > 0) { + const run = runs.data.workflow_runs[0].id; + const isLastWorkFlowFailed = await checkIfLastWorkFlowFailed(run); + if (isLastWorkFlowFailed) { + core.debug(`Rerunning build run ${run}`); + await reRunWorkflow(run).catch(error => core.error(`Error occurred when re-running the workflow: ${error}`)); } + } +} +async function getBranchOfPullRequest() { + const pullRequest = await octokit_1.octokit.pulls.get({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + pull_number: github_1.context.issue.number }); + return pullRequest.data.head.ref; } -exports.reRunLastWorkFlowIfRequired = reRunLastWorkFlowIfRequired; -function getBranchOfPullRequest() { - return __awaiter(this, void 0, void 0, function* () { - const pullRequest = yield octokit_1.octokit.pulls.get({ +async function getSelfWorkflowId() { + const perPage = 30; + let hasNextPage = true; + for (let page = 1; hasNextPage === true; page++) { + const workflowList = await octokit_1.octokit.actions.listRepoWorkflows({ owner: github_1.context.repo.owner, repo: github_1.context.repo.repo, - pull_number: github_1.context.issue.number + per_page: perPage, + page }); - return pullRequest.data.head.ref; - }); -} -function getSelfWorkflowId() { - return __awaiter(this, void 0, void 0, function* () { - const perPage = 30; - let hasNextPage = true; - for (let page = 1; hasNextPage === true; page++) { - const workflowList = yield octokit_1.octokit.actions.listRepoWorkflows({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - per_page: perPage, - page - }); - if (workflowList.data.total_count < page * perPage) { - hasNextPage = false; - } - const workflow = workflowList.data.workflows.find(w => w.name == github_1.context.workflow); - if (workflow) { - return workflow.id; - } + if (workflowList.data.total_count < page * perPage) { + hasNextPage = false; } - throw new Error(`Unable to locate this workflow's ID in this repository, can't trigger job..`); - }); + const workflow = workflowList.data.workflows.find(w => w.name == github_1.context.workflow); + if (workflow) { + return workflow.id; + } + } + throw new Error(`Unable to locate this workflow's ID in this repository, can't trigger job..`); } -function listWorkflowRunsInBranch(branch, workflowId) { - return __awaiter(this, void 0, void 0, function* () { - console.debug(branch); - const runs = yield octokit_1.octokit.actions.listWorkflowRuns({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - branch, - workflow_id: workflowId, - event: 'pull_request_target' - }); - return runs; +async function listWorkflowRunsInBranch(branch, workflowId) { + console.debug(branch); + const runs = await octokit_1.octokit.actions.listWorkflowRuns({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + branch, + workflow_id: workflowId, + event: 'pull_request_target' }); + return runs; } -function reRunWorkflow(run) { - return __awaiter(this, void 0, void 0, function* () { - // Personal Access token with repo scope is required to access this api - https://github.community/t/bug-rerun-workflow-api-not-working/126742 - yield octokit_1.octokit.actions.reRunWorkflow({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - run_id: run - }); +async function reRunWorkflow(run) { + // Personal Access token with repo scope is required to access this api - https://github.community/t/bug-rerun-workflow-api-not-working/126742 + await octokit_1.octokit.actions.reRunWorkflow({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + run_id: run }); } -function checkIfLastWorkFlowFailed(run) { - return __awaiter(this, void 0, void 0, function* () { - const response = yield octokit_1.octokit.actions.getWorkflowRun({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - run_id: run - }); - return response.data.conclusion == 'failure'; +async function checkIfLastWorkFlowFailed(run) { + const response = await octokit_1.octokit.actions.getWorkflowRun({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + run_id: run }); + return response.data.conclusion == 'failure'; } @@ -562,94 +539,76 @@ function checkIfLastWorkFlowFailed(run) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports["default"] = prCommentSetup; const octokit_1 = __nccwpck_require__(5957); const github_1 = __nccwpck_require__(3228); const signatureComment_1 = __importDefault(__nccwpck_require__(3708)); const pullRequestCommentContent_1 = __nccwpck_require__(8501); const getInputs_1 = __nccwpck_require__(7189); -function prCommentSetup(committerMap, committers) { - return __awaiter(this, void 0, void 0, function* () { - const signed = (committerMap === null || committerMap === void 0 ? void 0 : committerMap.notSigned) && (committerMap === null || committerMap === void 0 ? void 0 : committerMap.notSigned.length) === 0; - try { - const claBotComment = yield getComment(); - if (!claBotComment && !signed) { - return createComment(signed, committerMap); +async function prCommentSetup(committerMap, committers) { + const signed = committerMap?.notSigned && committerMap?.notSigned.length === 0; + try { + const claBotComment = await getComment(); + if (!claBotComment && !signed) { + return createComment(signed, committerMap); + } + else if (claBotComment?.id) { + if (signed) { + await updateComment(signed, committerMap, claBotComment); + return; // Early return - all contributors already signed, no need to check PR comment signatures } - else if (claBotComment === null || claBotComment === void 0 ? void 0 : claBotComment.id) { - if (signed) { - yield updateComment(signed, committerMap, claBotComment); - return; // Early return - all contributors already signed, no need to check PR comment signatures - } - // reacted committers are contributors who have newly signed by posting the Pull Request comment - const reactedCommitters = yield (0, signatureComment_1.default)(committerMap, committers); - if (reactedCommitters === null || reactedCommitters === void 0 ? void 0 : reactedCommitters.onlyCommitters) { - reactedCommitters.allSignedFlag = prepareAllSignedCommitters(committerMap, reactedCommitters.onlyCommitters, committers); - } - committerMap = prepareCommiterMap(committerMap, reactedCommitters); - yield updateComment(reactedCommitters.allSignedFlag, committerMap, claBotComment); - return reactedCommitters; + // reacted committers are contributors who have newly signed by posting the Pull Request comment + const reactedCommitters = await (0, signatureComment_1.default)(committerMap, committers); + if (reactedCommitters?.onlyCommitters) { + reactedCommitters.allSignedFlag = prepareAllSignedCommitters(committerMap, reactedCommitters.onlyCommitters, committers); } + committerMap = prepareCommiterMap(committerMap, reactedCommitters); + await updateComment(reactedCommitters.allSignedFlag, committerMap, claBotComment); + return reactedCommitters; } - catch (error) { - throw new Error(`Error occured when creating or editing the comments of the pull request: ${error.message}`); - } - }); + } + catch (error) { + throw new Error(`Error occured when creating or editing the comments of the pull request: ${error.message}`); + } } -exports["default"] = prCommentSetup; -function createComment(signed, committerMap) { - return __awaiter(this, void 0, void 0, function* () { - yield octokit_1.octokit.issues.createComment({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: github_1.context.issue.number, - body: (0, pullRequestCommentContent_1.commentContent)(signed, committerMap) - }).catch(error => { throw new Error(`Error occured when creating a pull request comment: ${error.message}`); }); - }); +async function createComment(signed, committerMap) { + await octokit_1.octokit.issues.createComment({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: github_1.context.issue.number, + body: (0, pullRequestCommentContent_1.commentContent)(signed, committerMap) + }).catch(error => { throw new Error(`Error occured when creating a pull request comment: ${error.message}`); }); } -function updateComment(signed, committerMap, claBotComment) { - return __awaiter(this, void 0, void 0, function* () { - yield octokit_1.octokit.issues.updateComment({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - comment_id: claBotComment.id, - body: (0, pullRequestCommentContent_1.commentContent)(signed, committerMap) - }).catch(error => { throw new Error(`Error occured when updating the pull request comment: ${error.message}`); }); - }); +async function updateComment(signed, committerMap, claBotComment) { + await octokit_1.octokit.issues.updateComment({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + comment_id: claBotComment.id, + body: (0, pullRequestCommentContent_1.commentContent)(signed, committerMap) + }).catch(error => { throw new Error(`Error occured when updating the pull request comment: ${error.message}`); }); } -function getComment() { - return __awaiter(this, void 0, void 0, function* () { - try { - const response = yield octokit_1.octokit.issues.listComments({ owner: github_1.context.repo.owner, repo: github_1.context.repo.repo, issue_number: github_1.context.issue.number }); - //TODO: check the below regex - // using a `string` true or false purposely as github action input cannot have a boolean value - if ((0, getInputs_1.getUseDcoFlag)() === 'true') { - return response.data.find(comment => comment.body.match(/.*DCO Assistant Lite bot.*/m)); - } - else if ((0, getInputs_1.getUseDcoFlag)() === 'false') { - return response.data.find(comment => comment.body.match(/.*CLA Assistant Lite bot.*/m)); - } +async function getComment() { + try { + const response = await octokit_1.octokit.issues.listComments({ owner: github_1.context.repo.owner, repo: github_1.context.repo.repo, issue_number: github_1.context.issue.number }); + //TODO: check the below regex + // using a `string` true or false purposely as github action input cannot have a boolean value + if ((0, getInputs_1.getUseDcoFlag)() === 'true') { + return response.data.find(comment => comment.body.match(/.*DCO Assistant Lite bot.*/m)); } - catch (error) { - throw new Error(`Error occured when getting all the comments of the pull request: ${error.message}`); + else if ((0, getInputs_1.getUseDcoFlag)() === 'false') { + return response.data.find(comment => comment.body.match(/.*CLA Assistant Lite bot.*/m)); } - }); + } + catch (error) { + throw new Error(`Error occured when getting all the comments of the pull request: ${error.message}`); + } } function prepareCommiterMap(committerMap, reactedCommitters) { - var _a; - (_a = committerMap.signed) === null || _a === void 0 ? void 0 : _a.push(...reactedCommitters.newSigned); + committerMap.signed?.push(...reactedCommitters.newSigned); committerMap.notSigned = committerMap.notSigned.filter(committer => !reactedCommitters.newSigned.some(reactedCommitter => committer.id === reactedCommitter.id)); return committerMap; } @@ -691,15 +650,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.commentContent = void 0; +exports.commentContent = commentContent; const input = __importStar(__nccwpck_require__(7189)); const pr_sign_comment_1 = __nccwpck_require__(7228); function commentContent(signed, committerMap) { @@ -711,7 +680,6 @@ function commentContent(signed, committerMap) { return cla(signed, committerMap); } } -exports.commentContent = commentContent; function dco(signed, committerMap) { if (signed) { const line1 = input.getCustomAllSignedPrComment() || `All contributors have signed the DCO ✍️ ✅`; @@ -811,113 +779,100 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.lockPullRequest = void 0; +exports.lockPullRequest = lockPullRequest; const octokit_1 = __nccwpck_require__(5957); const core = __importStar(__nccwpck_require__(7484)); const github_1 = __nccwpck_require__(3228); -function lockPullRequest() { - return __awaiter(this, void 0, void 0, function* () { - core.info('Locking the Pull Request to safe guard the Pull Request CLA Signatures'); - const pullRequestNo = github_1.context.issue.number; - try { - yield octokit_1.octokit.issues.lock({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: pullRequestNo - }); - core.info(`successfully locked the pull request ${pullRequestNo}`); - } - catch (e) { - core.error(`failed when locking the pull request `); - } - }); +async function lockPullRequest() { + core.info('Locking the Pull Request to safe guard the Pull Request CLA Signatures'); + const pullRequestNo = github_1.context.issue.number; + try { + await octokit_1.octokit.issues.lock({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: pullRequestNo + }); + core.info(`successfully locked the pull request ${pullRequestNo}`); + } + catch (e) { + core.error(`failed when locking the pull request `); + } } -exports.lockPullRequest = lockPullRequest; /***/ }), /***/ 3708: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports["default"] = signatureWithPRComment; const octokit_1 = __nccwpck_require__(5957); const github_1 = __nccwpck_require__(3228); const getInputs_1 = __nccwpck_require__(7189); -function signatureWithPRComment(committerMap, committers) { - return __awaiter(this, void 0, void 0, function* () { - let repoId = github_1.context.payload.repository.id; - let prResponse = yield octokit_1.octokit.issues.listComments({ - owner: github_1.context.repo.owner, - repo: github_1.context.repo.repo, - issue_number: github_1.context.issue.number - }); - let listOfPRComments = []; - let filteredListOfPRComments = []; - prResponse === null || prResponse === void 0 ? void 0 : prResponse.data.map((prComment) => { - listOfPRComments.push({ - name: prComment.user.login, - id: prComment.user.id, - comment_id: prComment.id, - body: prComment.body.trim().toLowerCase(), - created_at: prComment.created_at, - repoId: repoId, - pullRequestNo: github_1.context.issue.number - }); - }); - listOfPRComments.map(comment => { - if (isCommentSignedByUser(comment.body || "", comment.name)) { - filteredListOfPRComments.push(comment); - } +async function signatureWithPRComment(committerMap, committers) { + let repoId = github_1.context.payload.repository.id; + let prResponse = await octokit_1.octokit.issues.listComments({ + owner: github_1.context.repo.owner, + repo: github_1.context.repo.repo, + issue_number: github_1.context.issue.number + }); + let listOfPRComments = []; + let filteredListOfPRComments = []; + prResponse?.data.map((prComment) => { + listOfPRComments.push({ + name: prComment.user.login, + id: prComment.user.id, + comment_id: prComment.id, + body: prComment.body.trim().toLowerCase(), + created_at: prComment.created_at, + repoId: repoId, + pullRequestNo: github_1.context.issue.number }); - for (var i = 0; i < filteredListOfPRComments.length; i++) { - delete filteredListOfPRComments[i].body; + }); + listOfPRComments.map(comment => { + if (isCommentSignedByUser(comment.body || "", comment.name)) { + filteredListOfPRComments.push(comment); } - /* - *checking if the reacted committers are not the signed committers(not in the storage file) and filtering only the unsigned committers - */ - const newSigned = filteredListOfPRComments.filter(commentedCommitter => committerMap.notSigned.some(notSignedCommitter => commentedCommitter.id === notSignedCommitter.id)); - /* - * checking if the commented users are only the contributors who has committed in the same PR (This is needed for the PR Comment and changing the status to success when all the contributors has reacted to the PR) - */ - const onlyCommitters = committers.filter(committer => filteredListOfPRComments.some(commentedCommitter => committer.id == commentedCommitter.id)); - const commentedCommitterMap = { - newSigned, - onlyCommitters, - allSignedFlag: false - }; - return commentedCommitterMap; }); + for (var i = 0; i < filteredListOfPRComments.length; i++) { + delete filteredListOfPRComments[i].body; + } + /* + *checking if the reacted committers are not the signed committers(not in the storage file) and filtering only the unsigned committers + */ + const newSigned = filteredListOfPRComments.filter(commentedCommitter => committerMap.notSigned.some(notSignedCommitter => commentedCommitter.id === notSignedCommitter.id)); + /* + * checking if the commented users are only the contributors who has committed in the same PR (This is needed for the PR Comment and changing the status to success when all the contributors has reacted to the PR) + */ + const onlyCommitters = committers.filter(committer => filteredListOfPRComments.some(commentedCommitter => committer.id == commentedCommitter.id)); + const commentedCommitterMap = { + newSigned, + onlyCommitters, + allSignedFlag: false + }; + return commentedCommitterMap; } -exports["default"] = signatureWithPRComment; function isCommentSignedByUser(comment, commentAuthor) { if (commentAuthor === 'github-actions[bot]') { return false; @@ -960,27 +915,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setupClaCheck = void 0; +exports.setupClaCheck = setupClaCheck; const core = __importStar(__nccwpck_require__(7484)); const github_1 = __nccwpck_require__(3228); const checkAllowList_1 = __nccwpck_require__(4715); @@ -989,138 +945,122 @@ const input = __importStar(__nccwpck_require__(7189)); const persistence_1 = __nccwpck_require__(9947); const pullRequestComment_1 = __importDefault(__nccwpck_require__(366)); const pullRerunRunner_1 = __nccwpck_require__(8109); -function setupClaCheck() { - return __awaiter(this, void 0, void 0, function* () { - let committerMap = getInitialCommittersMap(); - let committers = yield (0, graphql_1.default)(); - committers = yield (0, checkAllowList_1.checkAllowList)(committers); - const { claFileContent, sha } = (yield getCLAFileContentandSHA(committers, committerMap)); - committerMap = prepareCommiterMap(committers, claFileContent); - try { - const reactedCommitters = (yield (0, pullRequestComment_1.default)(committerMap, committers)); - if (reactedCommitters === null || reactedCommitters === void 0 ? void 0 : reactedCommitters.newSigned.length) { - /* pushing the recently signed contributors to the CLA Json File */ - yield (0, persistence_1.updateFile)(sha, claFileContent, reactedCommitters); - } - if ((reactedCommitters === null || reactedCommitters === void 0 ? void 0 : reactedCommitters.allSignedFlag) || - (committerMap === null || committerMap === void 0 ? void 0 : committerMap.notSigned) === undefined || - committerMap.notSigned.length === 0) { - core.info(`All contributors have signed the CLA 📝 ✅ `); - yield createSuccessSummary(committerMap); - return (0, pullRerunRunner_1.reRunLastWorkFlowIfRequired)(); - } - else { - yield createFailureSummary(committerMap); - core.setFailed(`${committerMap.notSigned.length} contributor(s) need to sign the CLA: ${committerMap.notSigned.map(c => `@${c.name}`).join(', ')}`); - } +async function setupClaCheck() { + let committerMap = getInitialCommittersMap(); + let committers = await (0, graphql_1.default)(); + committers = await (0, checkAllowList_1.checkAllowList)(committers); + const { claFileContent, sha } = (await getCLAFileContentandSHA(committers, committerMap)); + committerMap = prepareCommiterMap(committers, claFileContent); + try { + const reactedCommitters = (await (0, pullRequestComment_1.default)(committerMap, committers)); + if (reactedCommitters?.newSigned.length) { + /* pushing the recently signed contributors to the CLA Json File */ + await (0, persistence_1.updateFile)(sha, claFileContent, reactedCommitters); } - catch (err) { - core.info(JSON.stringify(err)); - core.setFailed(`Error: ${err.message}`); - yield createErrorSummary(err); + if (reactedCommitters?.allSignedFlag || + committerMap?.notSigned === undefined || + committerMap.notSigned.length === 0) { + core.info(`All contributors have signed the CLA 📝 ✅ `); + await createSuccessSummary(committerMap); + return (0, pullRerunRunner_1.reRunLastWorkFlowIfRequired)(); } - }); + else { + await createFailureSummary(committerMap); + core.setFailed(`${committerMap.notSigned.length} contributor(s) need to sign the CLA: ${committerMap.notSigned.map(c => `@${c.name}`).join(', ')}`); + } + } + catch (err) { + core.info(JSON.stringify(err)); + core.setFailed(`Error: ${err.message}`); + await createErrorSummary(err); + } } -exports.setupClaCheck = setupClaCheck; -function createSuccessSummary(committerMap) { - var _a, _b, _c; - return __awaiter(this, void 0, void 0, function* () { - const totalCount = (((_a = committerMap.signed) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = committerMap.notSigned) === null || _b === void 0 ? void 0 : _b.length) || 0) + (((_c = committerMap.unknown) === null || _c === void 0 ? void 0 : _c.length) || 0); - yield core.summary - .addHeading('✅ All Contributors Signed') - .addRaw(`All ${totalCount} contributor(s) have signed the CLA.`) - .addBreak() - .addTable([ - [{ data: 'Contributor', header: true }, { data: 'Status', header: true }], - ...(committerMap.signed || []).map(c => [c.name, '✅ Signed']) - ]) - .write(); - }); +async function createSuccessSummary(committerMap) { + const totalCount = (committerMap.signed?.length || 0) + (committerMap.notSigned?.length || 0) + (committerMap.unknown?.length || 0); + await core.summary + .addHeading('✅ All Contributors Signed') + .addRaw(`All ${totalCount} contributor(s) have signed the CLA.`) + .addBreak() + .addTable([ + [{ data: 'Contributor', header: true }, { data: 'Status', header: true }], + ...(committerMap.signed || []).map(c => [c.name, '✅ Signed']) + ]) + .write(); } -function createFailureSummary(committerMap) { - var _a, _b; - return __awaiter(this, void 0, void 0, function* () { - const totalCount = (((_a = committerMap.signed) === null || _a === void 0 ? void 0 : _a.length) || 0) + committerMap.notSigned.length + (((_b = committerMap.unknown) === null || _b === void 0 ? void 0 : _b.length) || 0); - const docUrl = input.getPathToDocument(); - yield core.summary - .addHeading('❌ CLA Signature Required') - .addRaw(`${committerMap.notSigned.length} of ${totalCount} contributors need to sign the CLA.`) - .addBreak() - .addHeading('Unsigned Contributors', 3) - .addList(committerMap.notSigned.map(c => `@${c.name}${c.email ? ` (${c.email})` : ''}`)) - .addBreak() - .addRaw(`📝 View CLA Document`) - .addBreak() - .addRaw('To sign: Comment on this PR with "I have read the CLA Document and I hereby sign the CLA"') - .write(); - // Add annotations for each unsigned contributor - committerMap.notSigned.forEach(c => { - core.warning(`@${c.name}${c.email ? ` (${c.email})` : ''} has not signed the CLA`, { - title: '📝 CLA Signature Required' - }); +async function createFailureSummary(committerMap) { + const totalCount = (committerMap.signed?.length || 0) + committerMap.notSigned.length + (committerMap.unknown?.length || 0); + const docUrl = input.getPathToDocument(); + await core.summary + .addHeading('❌ CLA Signature Required') + .addRaw(`${committerMap.notSigned.length} of ${totalCount} contributors need to sign the CLA.`) + .addBreak() + .addHeading('Unsigned Contributors', 3) + .addList(committerMap.notSigned.map(c => `@${c.name}${c.email ? ` (${c.email})` : ''}`)) + .addBreak() + .addRaw(`📝 View CLA Document`) + .addBreak() + .addRaw('To sign: Comment on this PR with "I have read the CLA Document and I hereby sign the CLA"') + .write(); + // Add annotations for each unsigned contributor + committerMap.notSigned.forEach(c => { + core.warning(`@${c.name}${c.email ? ` (${c.email})` : ''} has not signed the CLA`, { + title: '📝 CLA Signature Required' }); - // Add info about unknown users if any - if (committerMap.unknown && committerMap.unknown.length > 0) { - committerMap.unknown.forEach(c => { - core.notice(`@${c.name} appears to be committing without a linked GitHub account`, { - title: '⚠️ Unknown GitHub User' - }); - }); - } }); + // Add info about unknown users if any + if (committerMap.unknown && committerMap.unknown.length > 0) { + committerMap.unknown.forEach(c => { + core.notice(`@${c.name} appears to be committing without a linked GitHub account`, { + title: '⚠️ Unknown GitHub User' + }); + }); + } } -function createErrorSummary(err) { - return __awaiter(this, void 0, void 0, function* () { - yield core.summary - .addHeading('❌ CLA Check Error') - .addRaw(`An error occurred while checking CLA signatures:`) - .addBreak() - .addCodeBlock(err.message || JSON.stringify(err), 'text') - .write(); - }); +async function createErrorSummary(err) { + await core.summary + .addHeading('❌ CLA Check Error') + .addRaw(`An error occurred while checking CLA signatures:`) + .addBreak() + .addCodeBlock(err.message || JSON.stringify(err), 'text') + .write(); } -function getCLAFileContentandSHA(committers, committerMap) { - var _a; - return __awaiter(this, void 0, void 0, function* () { - let result, claFileContentString, claFileContent, sha; - try { - result = yield (0, persistence_1.getFileContent)(); +async function getCLAFileContentandSHA(committers, committerMap) { + let result, claFileContentString, claFileContent, sha; + try { + result = await (0, persistence_1.getFileContent)(); + } + catch (error) { + if (error.status === "404") { + return createClaFileAndPRComment(committers, committerMap); } - catch (error) { - if (error.status === "404") { - return createClaFileAndPRComment(committers, committerMap); - } - else { - throw new Error(`Could not retrieve repository contents. Status: ${error.status || 'unknown'}`); - } + else { + throw new Error(`Could not retrieve repository contents. Status: ${error.status || 'unknown'}`); } - sha = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.sha; - claFileContentString = Buffer.from(result.data.content, 'base64').toString(); - claFileContent = JSON.parse(claFileContentString); - return { claFileContent, sha }; - }); + } + sha = result?.data?.sha; + claFileContentString = Buffer.from(result.data.content, 'base64').toString(); + claFileContent = JSON.parse(claFileContentString); + return { claFileContent, sha }; } -function createClaFileAndPRComment(committers, committerMap) { - return __awaiter(this, void 0, void 0, function* () { - committerMap.notSigned = committers; - committerMap.signed = []; - committers.map(committer => { - if (!committer.id) { - committerMap.unknown.push(committer); - } - }); - const initialContent = { signedContributors: [] }; - const initialContentString = JSON.stringify(initialContent, null, 3); - const initialContentBinary = Buffer.from(initialContentString).toString('base64'); - yield (0, persistence_1.createFile)(initialContentBinary).catch(error => core.setFailed(`Error occurred when creating the signed contributors file: ${error.message || error}. Make sure the branch where signatures are stored is NOT protected.`)); - yield (0, pullRequestComment_1.default)(committerMap, committers); - throw new Error(`Committers of pull request ${github_1.context.issue.number} have to sign the CLA`); +async function createClaFileAndPRComment(committers, committerMap) { + committerMap.notSigned = committers; + committerMap.signed = []; + committers.map(committer => { + if (!committer.id) { + committerMap.unknown.push(committer); + } }); + const initialContent = { signedContributors: [] }; + const initialContentString = JSON.stringify(initialContent, null, 3); + const initialContentBinary = Buffer.from(initialContentString).toString('base64'); + await (0, persistence_1.createFile)(initialContentBinary).catch(error => core.setFailed(`Error occurred when creating the signed contributors file: ${error.message || error}. Make sure the branch where signatures are stored is NOT protected.`)); + await (0, pullRequestComment_1.default)(committerMap, committers); + throw new Error(`Committers of pull request ${github_1.context.issue.number} have to sign the CLA`); } function prepareCommiterMap(committers, claFileContent) { let committerMap = getInitialCommittersMap(); - committerMap.notSigned = committers.filter(committer => !((claFileContent === null || claFileContent === void 0 ? void 0 : claFileContent.signedContributors) || []).some(cla => committer.id === cla.id)); - committerMap.signed = committers.filter(committer => ((claFileContent === null || claFileContent === void 0 ? void 0 : claFileContent.signedContributors) || []).some(cla => committer.id === cla.id)); + committerMap.notSigned = committers.filter(committer => !(claFileContent?.signedContributors || []).some(cla => committer.id === cla.id)); + committerMap.signed = committers.filter(committer => (claFileContent?.signedContributors || []).some(cla => committer.id === cla.id)); committers.map(committer => { if (!committer.id) { committerMap.unknown.push(committer); @@ -1158,13 +1098,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getStatusContext = exports.suggestRecheck = exports.lockPullRequestAfterMerge = exports.getCustomPrSignComment = exports.getUseDcoFlag = exports.getCustomAllSignedPrComment = exports.getCustomNotSignedPrComment = exports.getCreateFileCommitMessage = exports.getSignedCommitMessage = exports.getEmptyCommitFlag = exports.getDomainsFile = exports.getDomainAllowList = exports.getUsernameAllowList = exports.getBranch = exports.getPathToDocument = exports.getPathToSignatures = exports.getRemoteOrgName = exports.getRemoteRepoName = void 0; const core = __importStar(__nccwpck_require__(7484)); @@ -1233,20 +1183,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getPrSignComment = void 0; +exports.getPrSignComment = getPrSignComment; const input = __importStar(__nccwpck_require__(7189)); function getPrSignComment() { return input.getCustomPrSignComment() || "I have read the CLA Document and I hereby sign the CLA"; } -exports.getPrSignComment = getPrSignComment; /***/ }), diff --git a/package-lock.json b/package-lock.json index d0d0b0ac..f03c8c27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,11 +20,11 @@ "devDependencies": { "@octokit/types": "8.1.1", "@types/jest": "^29.5.14", - "@types/node": "^18.11.18", + "@types/node": "^24.0.0", "@vercel/ncc": "^0.38.4", "jest": "^29.7.0", - "ts-jest": "^29.0.5", - "typescript": "^4.9.5" + "ts-jest": "^29.4.6", + "typescript": "^5.4.0" } }, "node_modules/@actions/core": { @@ -1844,9 +1844,13 @@ "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=" }, "node_modules/@types/node": { - "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + "version": "24.12.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz", + "integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -2934,6 +2938,28 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -5419,6 +5445,13 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -6180,37 +6213,44 @@ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, "node_modules/ts-jest": { - "version": "29.0.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.5.tgz", - "integrity": "sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==", + "version": "29.4.6", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.6.tgz", + "integrity": "sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==", "dev": true, + "license": "MIT", "dependencies": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", - "jest-util": "^29.0.0", + "bs-logger": "^0.2.6", + "fast-json-stable-stringify": "^2.1.0", + "handlebars": "^4.7.8", "json5": "^2.2.3", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "7.x", - "yargs-parser": "^21.0.1" + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.7.3", + "type-fest": "^4.41.0", + "yargs-parser": "^21.1.1" }, "bin": { "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", - "@jest/types": "^29.0.0", - "babel-jest": "^29.0.0", - "jest": "^29.0.0", - "typescript": ">=4.3" + "@jest/transform": "^29.0.0 || ^30.0.0", + "@jest/types": "^29.0.0 || ^30.0.0", + "babel-jest": "^29.0.0 || ^30.0.0", + "jest": "^29.0.0 || ^30.0.0", + "jest-util": "^29.0.0 || ^30.0.0", + "typescript": ">=4.3 <6" }, "peerDependenciesMeta": { "@babel/core": { "optional": true }, + "@jest/transform": { + "optional": true + }, "@jest/types": { "optional": true }, @@ -6219,17 +6259,18 @@ }, "esbuild": { "optional": true + }, + "jest-util": { + "optional": true } } }, "node_modules/ts-jest/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -6237,6 +6278,19 @@ "node": ">=10" } }, + "node_modules/ts-jest/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", @@ -6267,9 +6321,9 @@ } }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -6277,9 +6331,29 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, "node_modules/universal-user-agent": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.1.0.tgz", @@ -6407,6 +6481,13 @@ "node": ">=6" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "license": "MIT" + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index 820ddb16..e4f2f559 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,11 @@ "devDependencies": { "@octokit/types": "8.1.1", "@types/jest": "^29.5.14", - "@types/node": "^18.11.18", + "@types/node": "^24.0.0", "@vercel/ncc": "^0.38.4", "jest": "^29.7.0", - "ts-jest": "^29.0.5", - "typescript": "^4.9.5" + "ts-jest": "^29.4.6", + "typescript": "^5.4.0" }, "author": "ibakshay", "license": "Apache-2.0", diff --git a/tsconfig.json b/tsconfig.json index 0810897a..8b901ec1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "target": "es6", + "target": "ES2022", + "lib": ["ES2022", "ES2023"], "module": "commonjs", "outDir": "./lib", "useUnknownInCatchVariables":false, From caeaca49d35a4a4154ed1d50dbeab31e69fe9303 Mon Sep 17 00:00:00 2001 From: Alan Ryan <20208488+Alan-Ryan@users.noreply.github.com> Date: Wed, 11 Mar 2026 20:04:20 +0000 Subject: [PATCH 3/3] fix(deps): add npm overrides to resolve transitive dependency CVEs --- dist/index.js | 47 +++++- package-lock.json | 382 ++++++++++++++++++---------------------------- package.json | 9 +- 3 files changed, 199 insertions(+), 239 deletions(-) diff --git a/dist/index.js b/dist/index.js index 01d44517..98f1310a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -8087,7 +8087,7 @@ exports.Deprecation = Deprecation; var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.21'; + var VERSION = '4.17.23'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -11841,7 +11841,7 @@ exports.Deprecation = Deprecation; if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } + }; } return iteratee; }); @@ -12445,8 +12445,47 @@ exports.Deprecation = Deprecation; */ function baseUnset(object, path) { path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; + + // Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg + var index = -1, + length = path.length; + + if (!length) { + return true; + } + + var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function'); + + while (++index < length) { + var key = path[index]; + + // skip non-string keys (e.g., Symbols, numbers) + if (typeof key !== 'string') { + continue; + } + + // Always block "__proto__" anywhere in the path if it's not expected + if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) { + return false; + } + + // Block "constructor.prototype" chains + if (key === 'constructor' && + (index + 1) < length && + typeof path[index + 1] === 'string' && + path[index + 1] === 'prototype') { + + // Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a') + if (isRootPrimitive && index === 0) { + continue; + } + + return false; + } + } + + var obj = parent(object, path); + return obj == null || delete obj[toKey(last(path))]; } /** diff --git a/package-lock.json b/package-lock.json index f03c8c27..c104a7cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@octokit/rest": "^16.43.2", "actions-toolkit": "^2.1.0", "husky": "^4.3.8", - "lodash": "^4.17.21", + "lodash": "^4.17.23", "node-fetch": "^3.3.0" }, "devDependencies": { @@ -77,12 +77,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "license": "MIT", "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" @@ -143,15 +145,17 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", - "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.22.15", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" @@ -206,27 +210,12 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", - "dev": true, - "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -296,18 +285,20 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz", - "integrity": "sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -335,24 +326,15 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/parser": { - "version": "7.22.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", - "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", + "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -538,49 +520,48 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.22.17", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.17.tgz", - "integrity": "sha512-xK4Uwm0JnAMvxYZxOVecss85WxTEIbTa7bnGyf/+EgCL5Zt3U7htUpEOWv9detPlamGKuRzCqw74xVglDWpPdg==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.17", - "debug": "^4.1.0", - "globals": "^11.1.0" + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.22.17", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.17.tgz", - "integrity": "sha512-YSQPHLFtQNE5xN9tHuZnzu8vPr61wVTBZdfv1meex1NBosa4iT05k/Jw06ddJugi4bk7The/oSwQGFcksmEJQg==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.15", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -1340,17 +1321,14 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" } }, "node_modules/@jridgewell/resolve-uri": { @@ -1362,26 +1340,19 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", - "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -2193,12 +2164,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2521,18 +2493,26 @@ } }, "node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">=4.8" + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" } }, "node_modules/data-uri-to-buffer": { @@ -2777,10 +2757,11 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2924,15 +2905,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -3267,6 +3239,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -3293,7 +3266,8 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" }, "node_modules/isobject": { "version": "4.0.0", @@ -3445,20 +3419,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-changed-files/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/jest-changed-files/node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -3542,42 +3502,6 @@ "node": ">=8" } }, - "node_modules/jest-changed-files/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-changed-files/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-changed-files/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/jest-circus": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", @@ -5187,12 +5111,14 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -5202,15 +5128,16 @@ } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-parse-better-errors": { @@ -5285,9 +5212,10 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "license": "MIT" }, "node_modules/lodash.get": { "version": "4.4.2", @@ -5404,9 +5332,10 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5452,11 +5381,6 @@ "dev": true, "license": "MIT" }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -5672,10 +5596,10 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", @@ -5947,14 +5871,6 @@ "rimraf": "bin.js" } }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "bin": { - "semver": "bin/semver" - } - }, "node_modules/semver-compare": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", @@ -5972,22 +5888,24 @@ } }, "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", "dependencies": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/signal-exit": { @@ -6186,20 +6104,12 @@ "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -6452,14 +6362,18 @@ } }, "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, "bin": { - "which": "bin/which" + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, "node_modules/which-pm-runs": { diff --git a/package.json b/package.json index e4f2f559..2f66bfea 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@octokit/rest": "^16.43.2", "actions-toolkit": "^2.1.0", "husky": "^4.3.8", - "lodash": "^4.17.21", + "lodash": "^4.17.23", "node-fetch": "^3.3.0" }, "devDependencies": { @@ -40,6 +40,13 @@ "ts-jest": "^29.4.6", "typescript": "^5.4.0" }, + "overrides": { + "@babel/traverse": "^7.23.2", + "braces": "^3.0.3", + "cross-spawn": "^7.0.5", + "js-yaml": "^3.14.2", + "minimatch": "^3.1.4" + }, "author": "ibakshay", "license": "Apache-2.0", "bugs": {