mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-10 03:57:00 +00:00
Initial commit - Planning dependency updates
Co-authored-by: TylerDixon <4308048+TylerDixon@users.noreply.github.com>
This commit is contained in:
46
.licenses/npm/fast-content-type-parse.dep.yml
generated
46
.licenses/npm/fast-content-type-parse.dep.yml
generated
@@ -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: []
|
||||
|
||||
@@ -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`_.
|
||||
|
||||
|
||||
106
fix-regex.js
106
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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user