Move helper method to end of file and revert package-lock.json changes

Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-06 22:30:38 +00:00
parent 728b23b52d
commit 8a9be95424
3 changed files with 40 additions and 58 deletions

34
dist/index.js vendored
View File

@@ -36258,23 +36258,6 @@ const wrapRequire = new Proxy(require, {
process.on('unhandledRejection', handleError);
main().catch(handleError);
/**
* 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 - only keep alphanumeric, dots, hyphens, and underscores
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '');
if (!sanitized) {
return userAgent;
}
return `${userAgent} orchestration-id/${sanitized}`;
}
async function main() {
const token = core.getInput('github-token', { required: true });
const debug = core.getBooleanInput('debug');
@@ -36332,6 +36315,23 @@ 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 - only keep alphanumeric, dots, hyphens, and underscores
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '');
if (!sanitized) {
return userAgent;
}
return `${userAgent} orchestration-id/${sanitized}`;
}
})();