Fix capitalization issues
This commit is contained in:
committed by
pullfrog[bot]
parent
1f2f671be0
commit
101c666610
@@ -119867,6 +119867,40 @@ ${encodedEvent}` : ""}
|
||||
${runtimeContext}`;
|
||||
}
|
||||
|
||||
// utils/normalizeEnv.ts
|
||||
function normalizeEnv() {
|
||||
const upperKeys = /* @__PURE__ */ new Map();
|
||||
for (const key of Object.keys(process.env)) {
|
||||
const upper2 = key.toUpperCase();
|
||||
const existing = upperKeys.get(upper2) || [];
|
||||
existing.push(key);
|
||||
upperKeys.set(upper2, existing);
|
||||
}
|
||||
for (const [upperKey, keys] of upperKeys) {
|
||||
if (keys.length === 1) {
|
||||
const key = keys[0];
|
||||
if (key !== upperKey) {
|
||||
process.env[upperKey] = process.env[key];
|
||||
delete process.env[key];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
const values = keys.map((k) => process.env[k]);
|
||||
const uniqueValues = new Set(values);
|
||||
if (uniqueValues.size > 1) {
|
||||
log.warning(
|
||||
`env var conflict: ${keys.join(", ")} have different values. using uppercase ${upperKey}.`
|
||||
);
|
||||
}
|
||||
const preferredKey = keys.find((k) => k === upperKey) || keys[0];
|
||||
const preferredValue = process.env[preferredKey];
|
||||
for (const key of keys) {
|
||||
delete process.env[key];
|
||||
}
|
||||
process.env[upperKey] = preferredValue;
|
||||
}
|
||||
}
|
||||
|
||||
// utils/payload.ts
|
||||
import { isAbsolute, resolve } from "node:path";
|
||||
var ToolPermissionInput = type.enumerated("disabled", "enabled");
|
||||
@@ -138455,6 +138489,7 @@ async function resolveRunId(repoData) {
|
||||
async function main(core5) {
|
||||
var _stack2 = [];
|
||||
try {
|
||||
normalizeEnv();
|
||||
process.env.ORIGINAL_GITHUB_TOKEN = process.env.GITHUB_TOKEN;
|
||||
const payload = resolvePayload(core5);
|
||||
if (payload.cwd && process.cwd() !== payload.cwd) {
|
||||
|
||||
Reference in New Issue
Block a user