Skip to content

Commit 97f280b

Browse files
chore: sync actions from gh-aw@v0.77.3 (#126)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 8ef4fd0 commit 97f280b

5 files changed

Lines changed: 96 additions & 26 deletions

File tree

setup/js/create_pull_request.cjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const { isStagedMode } = require("./safe_output_helpers.cjs");
3333
const { normalizeCommitSHA } = require("./commit_sha_helpers.cjs");
3434
const { withRetry, RATE_LIMIT_RETRY_CONFIG } = require("./error_recovery.cjs");
3535
const { findAgent, getIssueDetails, assignAgentToIssue } = require("./assign_agent_helpers.cjs");
36-
const { ensureFullHistoryForBundle, extractBundlePrerequisiteCommits, linearizeRangeAsCommit } = require("./git_helpers.cjs");
36+
const { ensureFullHistoryForBundle, extractBundlePrerequisiteCommits, isShallowOrSparseCheckout, linearizeRangeAsCommit } = require("./git_helpers.cjs");
3737
const { parseDiffGitHeader: parseDiffGitHeaderPaths, extractDiffGitHeaderEntries } = require("./patch_path_helpers.cjs");
3838
const { resolveAllowedMentionsFromPayload } = require("./resolve_mentions_from_payload.cjs");
3939
const {
@@ -211,7 +211,15 @@ async function applyBundleToBranch(bundleFilePath, branchName, originalAgentBran
211211
core.warning(`Bundle fetch with ${bundleBranchRef} failed due to ${prerequisiteCommits.length} missing prerequisite commit(s); fetching prerequisites from origin and retrying`);
212212
core.info(`Prerequisite commits: ${summarizeListForLog(prerequisiteCommits)}`);
213213
core.info(`Fetching ${prerequisiteCommits.length} prerequisite commit(s) from origin`);
214-
await execApi.exec("git", ["fetch", "origin", ...prerequisiteCommits]);
214+
// Use --filter=blob:none only when the local repo is already shallow or sparse —
215+
// in a full clone we already have all blobs and must not convert the repo to a
216+
// partial clone (which would trigger lazy blob fetches on later operations).
217+
const useBlobFilter = await isShallowOrSparseCheckout(execApi);
218+
const prerequisiteFetchArgs = useBlobFilter ? ["fetch", "--filter=blob:none", "origin", ...prerequisiteCommits] : ["fetch", "origin", ...prerequisiteCommits];
219+
if (useBlobFilter) {
220+
core.info("Using --filter=blob:none for prerequisite fetch (shallow or sparse checkout detected)");
221+
}
222+
await execApi.exec("git", prerequisiteFetchArgs);
215223
core.info("Fetched prerequisite commits from origin successfully");
216224
try {
217225
core.info(`Retrying bundle fetch from ${bundleBranchRef} into ${bundleTempRef} after prerequisite recovery`);

setup/js/git_helpers.cjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,44 @@ async function ensureFullHistoryForBundle(execApi, options = {}) {
180180
}
181181
}
182182

183+
/**
184+
* Return true when the local repository is shallow OR has sparse-checkout enabled.
185+
*
186+
* This is the gate for using `--filter=blob:none` on follow-up fetches (e.g. bundle
187+
* prerequisite recovery). In a full, non-sparse clone the repo already contains all
188+
* blobs for committed history; adding `--filter=blob:none` to a fetch would convert
189+
* it to a partial clone and cause subsequent operations to lazily re-fetch blobs.
190+
* In shallow or sparse checkouts we already accept partial object availability, so
191+
* filtering blobs is consistent and saves bandwidth.
192+
*
193+
* Both probes are best-effort — on any error we return `false` (do not filter),
194+
* which is the safe default that preserves the legacy unfiltered fetch behavior.
195+
*
196+
* @param {{ getExecOutput: Function }} execApi - Exec API to run git commands.
197+
* @param {Object} [options] - Options passed through to exec calls.
198+
* @returns {Promise<boolean>}
199+
*/
200+
async function isShallowOrSparseCheckout(execApi, options = {}) {
201+
const probeOptions = { ...options, ignoreReturnCode: true };
202+
try {
203+
const { stdout, exitCode } = await execApi.getExecOutput("git", ["rev-parse", "--is-shallow-repository"], probeOptions);
204+
if (exitCode === 0 && stdout.trim() === "true") {
205+
return true;
206+
}
207+
} catch {
208+
// Fall through to sparse check; if both probes fail, return false (no filter).
209+
}
210+
try {
211+
const { stdout, exitCode } = await execApi.getExecOutput("git", ["config", "--get", "core.sparseCheckout"], probeOptions);
212+
if (exitCode === 0 && stdout.trim().toLowerCase() === "true") {
213+
return true;
214+
}
215+
} catch {
216+
// Fall through.
217+
}
218+
return false;
219+
}
220+
183221
/**
184222
* Extract prerequisite commit SHAs from git bundle fetch error output.
185223
*
@@ -265,5 +303,6 @@ module.exports = {
265303
extractBundlePrerequisiteCommits,
266304
getGitAuthEnv,
267305
hasMergeCommitsInRange,
306+
isShallowOrSparseCheckout,
268307
linearizeRangeAsCommit,
269308
};

setup/js/model_multipliers.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,10 @@
3737
"claude-opus-4.6": 27.0,
3838
"claude-3-5-opus": 5.0,
3939
"claude-3-opus": 5.0,
40-
"gpt-4o": 0.33,
4140
"gpt-4o-2024-05-13": 0.33,
4241
"gpt-4o-2024-08-06": 0.33,
4342
"gpt-4o-2024-11-20": 0.33,
44-
"gpt-4o-mini": 0.33,
4543
"gpt-4o-mini-2024-07-18": 0.33,
46-
"gpt-4.1": 1.0,
4744
"gpt-4.1-2025-04-14": 1.0,
4845
"gpt-41-copilot": 1.0,
4946
"gpt-4.1-mini": 1.0,
@@ -86,7 +83,6 @@
8683
"gpt-5.4-2026-03-05": 6.0,
8784
"gpt-5.4-mini": 6.0,
8885
"gpt-5.4-mini-2026-03-17": 6.0,
89-
"gpt-5.4-nano": 6.0,
9086
"gpt-5.4-nano-2026-03-17": 6.0,
9187
"gpt-5.4-pro": 6.0,
9288
"gpt-5.4-pro-2026-03-05": 6.0,

setup/js/push_to_pull_request_branch.cjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const { createAuthenticatedGitHubClient } = require("./handler_auth.cjs");
1717
const { checkFileProtection } = require("./manifest_file_helpers.cjs");
1818
const { buildWorkflowRunUrl } = require("./workflow_metadata_helpers.cjs");
1919
const { renderTemplateFromFile, buildProtectedFileList, getPromptPath } = require("./messages_core.cjs");
20-
const { ensureFullHistoryForBundle, getGitAuthEnv, extractBundlePrerequisiteCommits, linearizeRangeAsCommit } = require("./git_helpers.cjs");
20+
const { ensureFullHistoryForBundle, getGitAuthEnv, extractBundlePrerequisiteCommits, isShallowOrSparseCheckout, linearizeRangeAsCommit } = require("./git_helpers.cjs");
2121
const { normalizeCommitSHA } = require("./commit_sha_helpers.cjs");
2222
const { findRepoCheckout } = require("./find_repo_checkout.cjs");
2323
const { getThreatDetectedMarker } = require("./threat_detection_warning.cjs");
@@ -742,7 +742,16 @@ async function main(config = {}) {
742742
if (prerequisiteCommits.length > 0) {
743743
core.warning(`Bundle fetch failed due to ${prerequisiteCommits.length} missing prerequisite commit(s); fetching prerequisites from origin and retrying`);
744744
core.info(`Fetching ${prerequisiteCommits.length} prerequisite commit(s) from origin`);
745-
await exec.exec("git", ["fetch", "origin", ...prerequisiteCommits], { env: { ...process.env, ...gitAuthEnv }, ...baseGitOpts });
745+
// Use --filter=blob:none only when the local repo is already shallow or sparse —
746+
// in a full clone we already have all blobs and must not convert the repo to a
747+
// partial clone (which would trigger lazy blob fetches on later operations).
748+
const prereqGitOpts = { env: { ...process.env, ...gitAuthEnv }, ...baseGitOpts };
749+
const useBlobFilter = await isShallowOrSparseCheckout(exec, prereqGitOpts);
750+
const prerequisiteFetchArgs = useBlobFilter ? ["fetch", "--filter=blob:none", "origin", ...prerequisiteCommits] : ["fetch", "origin", ...prerequisiteCommits];
751+
if (useBlobFilter) {
752+
core.info("Using --filter=blob:none for prerequisite fetch (shallow or sparse checkout detected)");
753+
}
754+
await exec.exec("git", prerequisiteFetchArgs, prereqGitOpts);
746755
core.info("Fetched prerequisite commits from origin successfully");
747756
await exec.exec("git", ["fetch", bundleFilePath, bundleFetchRef], baseGitOpts);
748757
core.info("Bundle fetch retry succeeded after prerequisite recovery");

setup/sh/install_antigravity_cli.sh

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ set +o histexpand
1313
# Security features:
1414
# - Downloads binary directly from Google Cloud Storage over HTTPS
1515
# - Verifies SHA256 checksum against official checksums.txt before installation
16+
# - Warns and skips checksum verification if checksums.txt is unavailable (HTTP 404)
1617
# - Fails fast if checksum verification fails
1718
# - Fails fast on any curl errors
1819

@@ -74,34 +75,51 @@ sha256_hash() {
7475
TEMP_DIR=$(mktemp -d)
7576
trap 'rm -rf "$TEMP_DIR"' EXIT
7677

77-
# Download checksums file from GCS
78+
# Download checksums file from GCS (if available for this version)
7879
echo "Downloading checksums from ${CHECKSUMS_URL}..."
79-
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"
80+
if ! CHECKSUMS_DOWNLOAD_STATUS=$(curl -sSL --retry 3 --retry-delay 5 -w "%{http_code}" -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"); then
81+
echo "ERROR: Failed to download checksums.txt due to a network or TLS error"
82+
exit 1
83+
fi
84+
85+
VERIFY_CHECKSUM=true
86+
if [ "${CHECKSUMS_DOWNLOAD_STATUS}" = "404" ]; then
87+
echo "WARNING: checksums.txt not found for version ${VERSION}; skipping checksum verification."
88+
rm -f "${TEMP_DIR}/checksums.txt"
89+
VERIFY_CHECKSUM=false
90+
elif [ "${CHECKSUMS_DOWNLOAD_STATUS}" != "200" ]; then
91+
echo "ERROR: Failed to download checksums.txt (HTTP ${CHECKSUMS_DOWNLOAD_STATUS})"
92+
exit 1
93+
fi
8094

8195
# Download binary tarball from GCS over HTTPS
8296
echo "Downloading from ${TARBALL_URL}..."
8397
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"
8498

85-
# Verify SHA256 checksum before extracting
86-
echo "Verifying SHA256 checksum for ${TARBALL_NAME}..."
87-
EXPECTED_CHECKSUM=$(awk -v fname="${TARBALL_NAME}" '$2 == fname {print $1; exit}' "${TEMP_DIR}/checksums.txt" | tr 'A-F' 'a-f')
99+
# Verify SHA256 checksum before extracting (when checksums.txt is available)
100+
if [ "${VERIFY_CHECKSUM}" = "true" ]; then
101+
echo "Verifying SHA256 checksum for ${TARBALL_NAME}..."
102+
EXPECTED_CHECKSUM=$(awk -v fname="${TARBALL_NAME}" '$2 == fname {print $1; exit}' "${TEMP_DIR}/checksums.txt" | tr 'A-F' 'a-f')
88103

89-
if [ -z "$EXPECTED_CHECKSUM" ]; then
90-
echo "ERROR: Could not find checksum for ${TARBALL_NAME} in checksums.txt"
91-
exit 1
92-
fi
104+
if [ -z "$EXPECTED_CHECKSUM" ]; then
105+
echo "ERROR: Could not find checksum for ${TARBALL_NAME} in checksums.txt"
106+
exit 1
107+
fi
93108

94-
ACTUAL_CHECKSUM=$(sha256_hash "${TEMP_DIR}/${TARBALL_NAME}" | tr 'A-F' 'a-f')
109+
ACTUAL_CHECKSUM=$(sha256_hash "${TEMP_DIR}/${TARBALL_NAME}" | tr 'A-F' 'a-f')
95110

96-
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
97-
echo "ERROR: Checksum verification failed!"
98-
echo " Expected: $EXPECTED_CHECKSUM"
99-
echo " Got: $ACTUAL_CHECKSUM"
100-
echo " The downloaded file may be corrupted or tampered with"
101-
exit 1
102-
fi
111+
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
112+
echo "ERROR: Checksum verification failed!"
113+
echo " Expected: $EXPECTED_CHECKSUM"
114+
echo " Got: $ACTUAL_CHECKSUM"
115+
echo " The downloaded file may be corrupted or tampered with"
116+
exit 1
117+
fi
103118

104-
echo "✓ Checksum verification passed for ${TARBALL_NAME}"
119+
echo "✓ Checksum verification passed for ${TARBALL_NAME}"
120+
else
121+
echo "WARNING: Proceeding without checksum verification for ${TARBALL_NAME}"
122+
fi
105123

106124
# Extract and install binary
107125
echo "Installing binary to ${INSTALL_DIR}/${BINARY_NAME}..."

0 commit comments

Comments
 (0)