From 88e24e2557d5c4e2d50030f5ec6c027c439e4800 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 15:35:33 +0000 Subject: [PATCH] Initial commit - Planning dependency updates Co-authored-by: TylerDixon <4308048+TylerDixon@users.noreply.github.com> --- .licenses/npm/fast-content-type-parse.dep.yml | 46 ++++---- README.md | 1 - fix-regex.js | 106 +++++++++--------- 3 files changed, 76 insertions(+), 77 deletions(-) diff --git a/.licenses/npm/fast-content-type-parse.dep.yml b/.licenses/npm/fast-content-type-parse.dep.yml index e411b38..2372861 100644 --- a/.licenses/npm/fast-content-type-parse.dep.yml +++ b/.licenses/npm/fast-content-type-parse.dep.yml @@ -6,32 +6,32 @@ summary: Parse HTTP Content-Type header according to RFC 7231 homepage: https://github.com/fastify/fast-content-type-parse#readme license: other licenses: -- sources: LICENSE - text: |- - MIT License + - sources: LICENSE + text: |- + MIT License - Copyright (c) 2023 The Fastify Team + Copyright (c) 2023 The Fastify Team - The Fastify team members are listed at https://github.com/fastify/fastify#team - and in the README file. + The Fastify team members are listed at https://github.com/fastify/fastify#team + and in the README file. - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -- sources: README.md - text: Licensed under [MIT](./LICENSE). + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + - sources: README.md + text: Licensed under [MIT](./LICENSE). notices: [] diff --git a/README.md b/README.md index 4ec625d..be7cf8c 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,6 @@ Using these events ensure that a given issue or pull request, in the workflow's ## Creating a PAT and adding it to your repository - Create a new [personal access token](https://github.com/settings/tokens/new). _See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information_ - - For **Tokens (classic)** include the `project` scope; for private repos you will also need `repo` scope. - For **Fine-grained tokens**, you must first select the appropriate _owner_ and associated _repositories_. Then select _Organization permissions -> `projects` `read & write`_, and _Repository permissions -> `issues` `read-only`_ and _`pull requests` `read-only`_. diff --git a/fix-regex.js b/fix-regex.js index cbcdd6d..82327fe 100644 --- a/fix-regex.js +++ b/fix-regex.js @@ -8,9 +8,9 @@ const fs = require('fs') const filesToFix = [ - 'node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js', - 'node_modules/@actions/github/node_modules/@octokit/request/dist-node/index.js', - 'node_modules/@actions/github/node_modules/@octokit/request/dist-web/index.js', + 'node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js', + 'node_modules/@actions/github/node_modules/@octokit/request/dist-node/index.js', + 'node_modules/@actions/github/node_modules/@octokit/request/dist-web/index.js', ] /** @@ -19,13 +19,13 @@ const filesToFix = [ * @returns {string} - The fixed content */ function applyRegexFix(content) { - let fixedContent = content - - // Fix the problematic regex pattern - add proper grouping to fix operator precedence - fixedContent = fixedContent.replace(/\/\^text\\?\/\|charset=utf-8\$?\//g, '/^(text\\/|charset=utf-8)$/') - fixedContent = fixedContent.replace(/\/\^text\/\|charset=utf-8\$?\//g, '/^(text/|charset=utf-8)$/') - - return fixedContent + let fixedContent = content + + // Fix the problematic regex pattern - add proper grouping to fix operator precedence + fixedContent = fixedContent.replace(/\/\^text\\?\/\|charset=utf-8\$?\//g, '/^(text\\/|charset=utf-8)$/') + fixedContent = fixedContent.replace(/\/\^text\/\|charset=utf-8\$?\//g, '/^(text/|charset=utf-8)$/') + + return fixedContent } /** @@ -34,20 +34,20 @@ function applyRegexFix(content) { * @returns {{fixed: boolean, error: string|null}} - Result of the fix operation */ function fixFile(filePath) { - try { - const content = fs.readFileSync(filePath, 'utf8') - const originalContent = content - const fixedContent = applyRegexFix(content) + try { + const content = fs.readFileSync(filePath, 'utf8') + const originalContent = content + const fixedContent = applyRegexFix(content) - if (fixedContent !== originalContent) { - fs.writeFileSync(filePath, fixedContent, 'utf8') - return { fixed: true, error: null } - } else { - return { fixed: false, error: null } - } - } catch (error) { - return { fixed: false, error: error.message } + if (fixedContent !== originalContent) { + fs.writeFileSync(filePath, fixedContent, 'utf8') + return {fixed: true, error: null} + } else { + return {fixed: false, error: null} } + } catch (error) { + return {fixed: false, error: error.message} + } } /** @@ -56,50 +56,50 @@ function fixFile(filePath) { * @returns {{filesFixed: number, results: Array}} - Summary of fix operations */ function fixAllFiles(files = filesToFix) { - const results = [] - let filesFixed = 0 + const results = [] + let filesFixed = 0 - for (const filePath of files) { - const result = fixFile(filePath) - results.push({ filePath, ...result }) - - if (result.fixed) { - filesFixed++ - } + for (const filePath of files) { + const result = fixFile(filePath) + results.push({filePath, ...result}) + + if (result.fixed) { + filesFixed++ } + } - return { filesFixed, results } + return {filesFixed, results} } // Main execution when run as script if (require.main === module) { - process.stdout.write('šŸ”§ Applying regex fix for @octokit/request...\n') + process.stdout.write('šŸ”§ Applying regex fix for @octokit/request...\n') - const { filesFixed, results } = fixAllFiles() + const {filesFixed, results} = fixAllFiles() - for (const result of results) { - if (result.error) { - if (result.error.includes('ENOENT') || result.error.includes('no such file')) { - process.stdout.write(`āš ļø File not found: ${result.filePath}\n`) - } else { - process.stderr.write(`āŒ Error fixing ${result.filePath}: ${result.error}\n`) - } - } else if (result.fixed) { - process.stdout.write(`āœ… Fixed: ${result.filePath}\n`) - } else { - process.stdout.write(`ā„¹ļø No changes needed: ${result.filePath}\n`) - } + for (const result of results) { + if (result.error) { + if (result.error.includes('ENOENT') || result.error.includes('no such file')) { + process.stdout.write(`āš ļø File not found: ${result.filePath}\n`) + } else { + process.stderr.write(`āŒ Error fixing ${result.filePath}: ${result.error}\n`) + } + } else if (result.fixed) { + process.stdout.write(`āœ… Fixed: ${result.filePath}\n`) + } else { + process.stdout.write(`ā„¹ļø No changes needed: ${result.filePath}\n`) } + } - process.stdout.write(`\nšŸŽ‰ Fix complete! ${filesFixed} files updated.\n`) - if (filesFixed > 0) { - process.stdout.write('Run "npm run build:package" to rebuild with the fix.\n') - } + process.stdout.write(`\nšŸŽ‰ Fix complete! ${filesFixed} files updated.\n`) + if (filesFixed > 0) { + process.stdout.write('Run "npm run build:package" to rebuild with the fix.\n') + } } // Export functions for testing module.exports = { - applyRegexFix, - fixFile, - fixAllFiles + applyRegexFix, + fixFile, + fixAllFiles, }