@synkro-sh/cli 1.3.22 → 1.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap.js +11 -4
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -3333,7 +3333,7 @@ function writeConfigEnv(opts) {
|
|
|
3333
3333
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
3334
3334
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
3335
3335
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
3336
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.3.
|
|
3336
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.3.24")}`
|
|
3337
3337
|
];
|
|
3338
3338
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|
|
3339
3339
|
if (safeOrgId) lines.push(`SYNKRO_ORG_ID=${shellQuoteSingle(safeOrgId)}`);
|
|
@@ -4384,13 +4384,20 @@ function getPrFiles(repo, prNumber) {
|
|
|
4384
4384
|
async function fetchScanContext(gatewayUrl, apiKey, repo, prNumber, sha) {
|
|
4385
4385
|
try {
|
|
4386
4386
|
const url = `${gatewayUrl.replace(/\/$/, "")}/api/pr-scans/scan-context?repo=${encodeURIComponent(repo)}&pr_number=${prNumber}&sha=${sha}`;
|
|
4387
|
+
const headers = { "x-synkro-api-key": apiKey };
|
|
4388
|
+
const ghToken = process.env.GH_TOKEN || process.env.GITHUB_TOKEN || "";
|
|
4389
|
+
if (ghToken) headers["x-github-token"] = ghToken;
|
|
4390
|
+
console.log(`[scan-context] POST ${url}`);
|
|
4387
4391
|
const resp = await fetch(url, {
|
|
4388
|
-
headers
|
|
4392
|
+
headers,
|
|
4389
4393
|
signal: AbortSignal.timeout(15e3)
|
|
4390
4394
|
});
|
|
4395
|
+
const body = await resp.text();
|
|
4396
|
+
console.log(`[scan-context] ${resp.status}: ${body.slice(0, 300)}`);
|
|
4391
4397
|
if (!resp.ok) return { scan_all: true };
|
|
4392
|
-
return
|
|
4393
|
-
} catch {
|
|
4398
|
+
return JSON.parse(body);
|
|
4399
|
+
} catch (err) {
|
|
4400
|
+
console.warn(`[scan-context] error: ${err.message}`);
|
|
4394
4401
|
return { scan_all: true };
|
|
4395
4402
|
}
|
|
4396
4403
|
}
|