diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 8e9a221..303b132 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,6 +15,6 @@ jobs: # For actionlint - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 # For pin-github-action - - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 # Run all hooks - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 diff --git a/actions/backport_reminder/index.js b/actions/backport_reminder/index.js index 3d1e885..5597d4c 100644 --- a/actions/backport_reminder/index.js +++ b/actions/backport_reminder/index.js @@ -22680,6 +22680,19 @@ function getProxyFetch(destinationUrl) { function getApiBaseUrl() { return process.env["GITHUB_API_URL"] || "https://api.github.com"; } +function getUserAgentWithOrchestrationId(baseUserAgent) { + var _a; + const orchId = (_a = process.env["ACTIONS_ORCHESTRATION_ID"]) === null || _a === void 0 ? void 0 : _a.trim(); + if (orchId) { + const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, "_"); + const tag = `actions_orchestration_id/${sanitizedId}`; + if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag)) + return baseUserAgent; + const ua = baseUserAgent ? `${baseUserAgent} ` : ""; + return `${ua}${tag}`; + } + return baseUserAgent; +} // node_modules/universal-user-agent/index.js function getUserAgent() { @@ -26291,6 +26304,10 @@ function getOctokitOptions(token2, options) { if (auth2) { opts.auth = auth2; } + const userAgent2 = getUserAgentWithOrchestrationId(opts.userAgent); + if (userAgent2) { + opts.userAgent = userAgent2; + } return opts; } diff --git a/actions/parse_backport_comments/index.js b/actions/parse_backport_comments/index.js index 0248937..649f6ed 100644 --- a/actions/parse_backport_comments/index.js +++ b/actions/parse_backport_comments/index.js @@ -22696,6 +22696,19 @@ function getProxyFetch(destinationUrl) { function getApiBaseUrl() { return process.env["GITHUB_API_URL"] || "https://api.github.com"; } +function getUserAgentWithOrchestrationId(baseUserAgent) { + var _a; + const orchId = (_a = process.env["ACTIONS_ORCHESTRATION_ID"]) === null || _a === void 0 ? void 0 : _a.trim(); + if (orchId) { + const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, "_"); + const tag = `actions_orchestration_id/${sanitizedId}`; + if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag)) + return baseUserAgent; + const ua = baseUserAgent ? `${baseUserAgent} ` : ""; + return `${ua}${tag}`; + } + return baseUserAgent; +} // node_modules/universal-user-agent/index.js function getUserAgent() { @@ -26307,6 +26320,10 @@ function getOctokitOptions(token, options) { if (auth2) { opts.auth = auth2; } + const userAgent2 = getUserAgentWithOrchestrationId(opts.userAgent); + if (userAgent2) { + opts.userAgent = userAgent2; + } return opts; } diff --git a/package-lock.json b/package-lock.json index cefe8e4..1b5488f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ }, "devDependencies": { "@actions/core": "^3.0.0", - "@actions/github": "^9.0.0", + "@actions/github": "^9.1.0", "@types/js-yaml": "^4.0.5", "@types/node": "^25.6.0", "esbuild": "^0.28.0", @@ -39,9 +39,9 @@ } }, "node_modules/@actions/github": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-9.0.0.tgz", - "integrity": "sha512-yJ0RoswsAaKcvkmpCE4XxBRiy/whH2SdTBHWzs0gi4wkqTDhXMChjSdqBz/F4AeiDlP28rQqL33iHb+kjAMX6w==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-9.1.0.tgz", + "integrity": "sha512-u0hDGQeCS+7VNoLA8hYG65RLdPLMaPGfka0sZ0up7P0AiShqfX6xcuXNteGkQ7X7Tod7AMNwHd4p7DS63i8zzA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 738e514..c01c6dc 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "@actions/core": "^3.0.0", - "@actions/github": "^9.0.0", + "@actions/github": "^9.1.0", "@types/js-yaml": "^4.0.5", "@types/node": "^25.6.0", "esbuild": "^0.28.0",