mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-11 12:37:16 +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
|
homepage: https://github.com/fastify/fast-content-type-parse#readme
|
||||||
license: other
|
license: other
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
text: |-
|
text: |-
|
||||||
MIT License
|
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
|
The Fastify team members are listed at https://github.com/fastify/fastify#team
|
||||||
and in the README file.
|
and in the README file.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
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
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
- sources: README.md
|
- sources: README.md
|
||||||
text: Licensed under [MIT](./LICENSE).
|
text: Licensed under [MIT](./LICENSE).
|
||||||
notices: []
|
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
|
## 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_
|
- 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 **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`_.
|
- 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`_.
|
||||||
|
|
||||||
|
|||||||
100
fix-regex.js
100
fix-regex.js
@@ -8,9 +8,9 @@
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
|
||||||
const filesToFix = [
|
const filesToFix = [
|
||||||
'node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.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-node/index.js',
|
||||||
'node_modules/@actions/github/node_modules/@octokit/request/dist-web/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
|
* @returns {string} - The fixed content
|
||||||
*/
|
*/
|
||||||
function applyRegexFix(content) {
|
function applyRegexFix(content) {
|
||||||
let fixedContent = content
|
let fixedContent = content
|
||||||
|
|
||||||
// Fix the problematic regex pattern - add proper grouping to fix operator precedence
|
// 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)$/')
|
||||||
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
|
return fixedContent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,20 +34,20 @@ function applyRegexFix(content) {
|
|||||||
* @returns {{fixed: boolean, error: string|null}} - Result of the fix operation
|
* @returns {{fixed: boolean, error: string|null}} - Result of the fix operation
|
||||||
*/
|
*/
|
||||||
function fixFile(filePath) {
|
function fixFile(filePath) {
|
||||||
try {
|
try {
|
||||||
const content = fs.readFileSync(filePath, 'utf8')
|
const content = fs.readFileSync(filePath, 'utf8')
|
||||||
const originalContent = content
|
const originalContent = content
|
||||||
const fixedContent = applyRegexFix(content)
|
const fixedContent = applyRegexFix(content)
|
||||||
|
|
||||||
if (fixedContent !== originalContent) {
|
if (fixedContent !== originalContent) {
|
||||||
fs.writeFileSync(filePath, fixedContent, 'utf8')
|
fs.writeFileSync(filePath, fixedContent, 'utf8')
|
||||||
return { fixed: true, error: null }
|
return {fixed: true, error: null}
|
||||||
} else {
|
} else {
|
||||||
return { fixed: false, error: null }
|
return {fixed: false, error: null}
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
return { fixed: false, error: error.message }
|
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return {fixed: false, error: error.message}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,50 +56,50 @@ function fixFile(filePath) {
|
|||||||
* @returns {{filesFixed: number, results: Array}} - Summary of fix operations
|
* @returns {{filesFixed: number, results: Array}} - Summary of fix operations
|
||||||
*/
|
*/
|
||||||
function fixAllFiles(files = filesToFix) {
|
function fixAllFiles(files = filesToFix) {
|
||||||
const results = []
|
const results = []
|
||||||
let filesFixed = 0
|
let filesFixed = 0
|
||||||
|
|
||||||
for (const filePath of files) {
|
for (const filePath of files) {
|
||||||
const result = fixFile(filePath)
|
const result = fixFile(filePath)
|
||||||
results.push({ filePath, ...result })
|
results.push({filePath, ...result})
|
||||||
|
|
||||||
if (result.fixed) {
|
if (result.fixed) {
|
||||||
filesFixed++
|
filesFixed++
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return { filesFixed, results }
|
return {filesFixed, results}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main execution when run as script
|
// Main execution when run as script
|
||||||
if (require.main === module) {
|
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) {
|
for (const result of results) {
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
if (result.error.includes('ENOENT') || result.error.includes('no such file')) {
|
if (result.error.includes('ENOENT') || result.error.includes('no such file')) {
|
||||||
process.stdout.write(`⚠️ File not found: ${result.filePath}\n`)
|
process.stdout.write(`⚠️ File not found: ${result.filePath}\n`)
|
||||||
} else {
|
} else {
|
||||||
process.stderr.write(`❌ Error fixing ${result.filePath}: ${result.error}\n`)
|
process.stderr.write(`❌ Error fixing ${result.filePath}: ${result.error}\n`)
|
||||||
}
|
}
|
||||||
} else if (result.fixed) {
|
} else if (result.fixed) {
|
||||||
process.stdout.write(`✅ Fixed: ${result.filePath}\n`)
|
process.stdout.write(`✅ Fixed: ${result.filePath}\n`)
|
||||||
} else {
|
} else {
|
||||||
process.stdout.write(`ℹ️ No changes needed: ${result.filePath}\n`)
|
process.stdout.write(`ℹ️ No changes needed: ${result.filePath}\n`)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
process.stdout.write(`\n🎉 Fix complete! ${filesFixed} files updated.\n`)
|
process.stdout.write(`\n🎉 Fix complete! ${filesFixed} files updated.\n`)
|
||||||
if (filesFixed > 0) {
|
if (filesFixed > 0) {
|
||||||
process.stdout.write('Run "npm run build:package" to rebuild with the fix.\n')
|
process.stdout.write('Run "npm run build:package" to rebuild with the fix.\n')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export functions for testing
|
// Export functions for testing
|
||||||
module.exports = {
|
module.exports = {
|
||||||
applyRegexFix,
|
applyRegexFix,
|
||||||
fixFile,
|
fixFile,
|
||||||
fixAllFiles
|
fixAllFiles,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user