Simplify user-agent logic and update integration test

Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-06 23:05:20 +00:00
parent c36bdc0a3a
commit c0078b2072
3 changed files with 3 additions and 10 deletions

5
dist/index.js vendored
View File

@@ -36267,7 +36267,7 @@ 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 === '' ? '' : userAgent || 'actions/github-script';
const baseUserAgent = userAgent || 'actions/github-script';
const finalUserAgent = getUserAgentWithOrchestrationId(baseUserAgent);
const opts = {
log: debug ? console : undefined,
@@ -36327,9 +36327,6 @@ function getUserAgentWithOrchestrationId(userAgent) {
}
// Sanitize orchestration ID - replace invalid characters with underscore
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '_');
if (!sanitized) {
return userAgent;
}
return `${userAgent} orchestration-id/${sanitized}`;
}