mirror of
https://github.com/actions/add-to-project.git
synced 2025-12-10 20:21:17 +00:00
Compare commits
6 Commits
0f28223e02
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ff5c6829f | ||
|
|
ee32b5c266 | ||
|
|
32da07cbb3 | ||
|
|
255643a289 | ||
|
|
88e24e2557 | ||
|
|
71190c8125 |
@@ -1,5 +0,0 @@
|
||||
dist/
|
||||
lib/
|
||||
node_modules/
|
||||
jest.config.js
|
||||
fix-regex.js
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint", "github", "jest", "prettier"],
|
||||
"extends": [
|
||||
"plugin:github/recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2019,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true,
|
||||
"jest/globals": true
|
||||
},
|
||||
"rules": {
|
||||
"filenames/match-regex": "off",
|
||||
"github/no-then": "off",
|
||||
"i18n-text/no-en": "off",
|
||||
"import/no-namespace": "off"
|
||||
}
|
||||
}
|
||||
34
.licenses/npm/@octokit/endpoint-11.0.0.dep.yml
generated
34
.licenses/npm/@octokit/endpoint-11.0.0.dep.yml
generated
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: '@octokit/endpoint'
|
||||
version: 11.0.0
|
||||
type: npm
|
||||
summary: Turns REST API endpoints into generic request options
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
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 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: '[MIT](LICENSE)'
|
||||
notices: []
|
||||
34
.licenses/npm/@octokit/endpoint-11.0.2.dep.yml
generated
Normal file
34
.licenses/npm/@octokit/endpoint-11.0.2.dep.yml
generated
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: "@octokit/endpoint"
|
||||
version: 11.0.2
|
||||
type: npm
|
||||
summary: Turns REST API endpoints into generic request options
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
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 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: "[MIT](LICENSE)"
|
||||
notices: []
|
||||
20
.licenses/npm/@octokit/openapi-types-27.0.0.dep.yml
generated
Normal file
20
.licenses/npm/@octokit/openapi-types-27.0.0.dep.yml
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: "@octokit/openapi-types"
|
||||
version: 27.0.0
|
||||
type: npm
|
||||
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
Copyright (c) GitHub 2025 - Licensed as MIT.
|
||||
|
||||
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 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: "[MIT](LICENSE)"
|
||||
notices: []
|
||||
35
.licenses/npm/@octokit/request-10.0.3.dep.yml
generated
35
.licenses/npm/@octokit/request-10.0.3.dep.yml
generated
@@ -1,35 +0,0 @@
|
||||
---
|
||||
name: '@octokit/request'
|
||||
version: 10.0.3
|
||||
type: npm
|
||||
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
|
||||
and Node
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
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 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: '[MIT](LICENSE)'
|
||||
notices: []
|
||||
35
.licenses/npm/@octokit/request-10.0.7.dep.yml
generated
Normal file
35
.licenses/npm/@octokit/request-10.0.7.dep.yml
generated
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: "@octokit/request"
|
||||
version: 10.0.7
|
||||
type: npm
|
||||
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
|
||||
and Node
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2018 Octokit contributors
|
||||
|
||||
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 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: "[MIT](LICENSE)"
|
||||
notices: []
|
||||
34
.licenses/npm/@octokit/request-error-7.1.0.dep.yml
generated
Normal file
34
.licenses/npm/@octokit/request-error-7.1.0.dep.yml
generated
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: "@octokit/request-error"
|
||||
version: 7.1.0
|
||||
type: npm
|
||||
summary: Error class for Octokit request errors
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2019 Octokit contributors
|
||||
|
||||
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 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: "[MIT](LICENSE)"
|
||||
notices: []
|
||||
20
.licenses/npm/@octokit/types-16.0.0.dep.yml
generated
Normal file
20
.licenses/npm/@octokit/types-16.0.0.dep.yml
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: "@octokit/types"
|
||||
version: 16.0.0
|
||||
type: npm
|
||||
summary: Shared TypeScript definitions for Octokit projects
|
||||
homepage:
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |
|
||||
MIT License Copyright (c) 2019 Octokit contributors
|
||||
|
||||
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 (including the next paragraph) 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: "[MIT](LICENSE)"
|
||||
notices: []
|
||||
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`_.
|
||||
|
||||
|
||||
78
eslint.config.mjs
Normal file
78
eslint.config.mjs
Normal file
@@ -0,0 +1,78 @@
|
||||
import eslint from '@eslint/js'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import github from 'eslint-plugin-github'
|
||||
import jest from 'eslint-plugin-jest'
|
||||
import globals from 'globals'
|
||||
|
||||
export default [
|
||||
// Ignore patterns
|
||||
{
|
||||
ignores: ['dist/**', 'lib/**', 'node_modules/**', '__tests__/fixtures/**', 'eslint.config.mjs'],
|
||||
},
|
||||
|
||||
// Base ESLint recommended rules
|
||||
eslint.configs.recommended,
|
||||
|
||||
// TypeScript ESLint recommended rules
|
||||
...tseslint.configs.recommended,
|
||||
|
||||
// GitHub plugin recommended rules
|
||||
github.getFlatConfigs().recommended,
|
||||
|
||||
// Configuration for CommonJS JavaScript files
|
||||
{
|
||||
files: ['**/*.js'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2019,
|
||||
sourceType: 'script',
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.es6,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Disable specific rules for CommonJS files
|
||||
'github/filenames-match-regex': 'off',
|
||||
'import/no-commonjs': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
'i18n-text/no-en': 'off',
|
||||
'import/no-namespace': 'off',
|
||||
'no-implicit-globals': 'off',
|
||||
'github/no-implicit-buggy-globals': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
// Configuration for TypeScript files
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 2019,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.es6,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Disable specific rules as in the original config
|
||||
'github/filenames-match-regex': 'off',
|
||||
'github/no-then': 'off',
|
||||
'i18n-text/no-en': 'off',
|
||||
'import/no-namespace': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
// Jest-specific configuration
|
||||
{
|
||||
files: ['**/*.test.ts', '**/*.test.js', '__tests__/**/*.ts'],
|
||||
...jest.configs['flat/recommended'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.jest,
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
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,
|
||||
}
|
||||
|
||||
1400
package-lock.json
generated
1400
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@@ -7,7 +7,7 @@
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/github": "^6.0.0",
|
||||
"@octokit/plugin-paginate-rest": "^13.0.1",
|
||||
"@octokit/request": "^10.0.3",
|
||||
"@octokit/request": "^10.0.7",
|
||||
"@octokit/request-error": "^6.1.7"
|
||||
},
|
||||
"engines": {
|
||||
@@ -15,21 +15,24 @@
|
||||
"npm": ">= 8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@github/prettier-config": "^0.0.6",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "24.5.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"@types/node": "^24.10.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
||||
"@typescript-eslint/parser": "^8.47.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"concurrently": "^9.2.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-github": "^5.0.1",
|
||||
"eslint-plugin-jest": "^28.11.0",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-github": "^6.0.0",
|
||||
"eslint-plugin-jest": "^29.1.0",
|
||||
"eslint-plugin-prettier": "^5.2.5",
|
||||
"globals": "^15.14.0",
|
||||
"jest": "^30.2.0",
|
||||
"prettier": "3.6.2",
|
||||
"ts-jest": "^29.4.5",
|
||||
"typescript": "^5.5.2"
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.47.0"
|
||||
},
|
||||
"keywords": [
|
||||
"actions",
|
||||
|
||||
Reference in New Issue
Block a user