Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
121f74df1a Bump @vercel/ncc from 0.38.0 to 0.38.4
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.0 to 0.38.4.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.0...0.38.4)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-version: 0.38.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-22 18:17:58 +00:00
5 changed files with 11 additions and 47 deletions

View File

@@ -167,7 +167,7 @@ jobs:
exit 1
fi
echo "- Validating user-agent set to an empty string"
expected="actions/github-script octokit-core.js/"
expected="octokit-core.js/"
if [[ "${{steps.user-agent-empty.outputs.result}}" != "$expected"* ]]; then
echo $'::error::\u274C' "Expected user-agent to start with '$expected', got ${{steps.user-agent-empty.outputs.result}}"
exit 1

18
dist/index.js vendored
View File

@@ -36267,11 +36267,9 @@ async function main() {
const retries = parseInt(core.getInput('retries'));
const exemptStatusCodes = parseNumberArray(core.getInput('retry-exempt-status-codes'));
const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults);
const baseUserAgent = userAgent || 'actions/github-script';
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent);
const opts = {
log: debug ? console : undefined,
userAgent: finalUserAgent,
userAgent: userAgent || undefined,
previews: previews ? previews.split(',') : undefined,
retry: retryOpts,
request: requestOpts
@@ -36315,20 +36313,6 @@ function handleError(err) {
console.error(err);
core.setFailed(`Unhandled error: ${err}`);
}
/**
* Gets the user agent string with orchestration ID appended if available
* @param userAgent The base user agent string
* @returns The user agent string with orchestration ID appended if ACTIONS_ORCHESTRATION_ID is set
*/
function getUserAgentWithOrchestrationId(userAgent) {
const orchestrationId = process.env['ACTIONS_ORCHESTRATION_ID'];
if (!orchestrationId) {
return userAgent;
}
// Sanitize orchestration ID - replace invalid characters with underscore
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '_');
return `${userAgent} actions_orchestration_id/${sanitized}`;
}
})();

14
package-lock.json generated
View File

@@ -23,7 +23,7 @@
"@types/jest": "^29.5.5",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"@vercel/ncc": "^0.38.0",
"@vercel/ncc": "^0.38.4",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
@@ -1942,9 +1942,9 @@
}
},
"node_modules/@vercel/ncc": {
"version": "0.38.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.0.tgz",
"integrity": "sha512-B4YKZMm/EqMptKSFyAq4q2SlgJe+VCmEH6Y8gf/E1pTlWbsUJpuH1ymik2Ex3aYO5mCWwV1kaSYHSQOT8+4vHA==",
"version": "0.38.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.4.tgz",
"integrity": "sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==",
"dev": true,
"bin": {
"ncc": "dist/ncc/cli.js"
@@ -8822,9 +8822,9 @@
}
},
"@vercel/ncc": {
"version": "0.38.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.0.tgz",
"integrity": "sha512-B4YKZMm/EqMptKSFyAq4q2SlgJe+VCmEH6Y8gf/E1pTlWbsUJpuH1ymik2Ex3aYO5mCWwV1kaSYHSQOT8+4vHA==",
"version": "0.38.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.4.tgz",
"integrity": "sha512-8LwjnlP39s08C08J5NstzriPvW1SP8Zfpp1BvC2sI35kPeZnHfxVkCwu4/+Wodgnd60UtT1n8K8zw+Mp7J9JmQ==",
"dev": true
},
"acorn": {

View File

@@ -52,7 +52,7 @@
"@types/jest": "^29.5.5",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"@vercel/ncc": "^0.38.0",
"@vercel/ncc": "^0.38.4",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",

View File

@@ -39,12 +39,9 @@ async function main(): Promise<void> {
defaultGitHubOptions
)
const baseUserAgent = userAgent || 'actions/github-script'
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent)
const opts: Options = {
log: debug ? console : undefined,
userAgent: finalUserAgent,
userAgent: userAgent || undefined,
previews: previews ? previews.split(',') : undefined,
retry: retryOpts,
request: requestOpts
@@ -99,20 +96,3 @@ function handleError(err: any): void {
console.error(err)
core.setFailed(`Unhandled error: ${err}`)
}
/**
* Gets the user agent string with orchestration ID appended if available
* @param userAgent The base user agent string
* @returns The user agent string with orchestration ID appended if ACTIONS_ORCHESTRATION_ID is set
*/
function getUserAgentWithOrchestrationId(userAgent: string): string {
const orchestrationId = process.env['ACTIONS_ORCHESTRATION_ID']
if (!orchestrationId) {
return userAgent
}
// Sanitize orchestration ID - replace invalid characters with underscore
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '_')
return `${userAgent} actions_orchestration_id/${sanitized}`
}