mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-27 07:58:50 +00:00
parent
df6c1bd759
commit
0ea0beb66e
3 changed files with 20 additions and 2 deletions
18
dist/index.js
generated
vendored
18
dist/index.js
generated
vendored
|
|
@ -29150,6 +29150,19 @@ function getProxyFetch(destinationUrl) {
|
||||||
function getApiBaseUrl() {
|
function getApiBaseUrl() {
|
||||||
return process.env['GITHUB_API_URL'] || 'https://api.github.com';
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
function getUserAgent() {
|
function getUserAgent() {
|
||||||
if (typeof navigator === "object" && "userAgent" in navigator) {
|
if (typeof navigator === "object" && "userAgent" in navigator) {
|
||||||
|
|
@ -33068,6 +33081,11 @@ function getOctokitOptions(token, options) {
|
||||||
if (auth) {
|
if (auth) {
|
||||||
opts.auth = auth;
|
opts.auth = auth;
|
||||||
}
|
}
|
||||||
|
// Orchestration ID
|
||||||
|
const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
|
||||||
|
if (userAgent) {
|
||||||
|
opts.userAgent = userAgent;
|
||||||
|
}
|
||||||
return opts;
|
return opts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sticky-pull-request-comment",
|
"name": "sticky-pull-request-comment",
|
||||||
"version": "3.0.3",
|
"version": "3.0.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Create comment on pull request, if exists update that comment.",
|
"description": "Create comment on pull request, if exists update that comment.",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue