From 59aad86964b2bf0b19079c41c8c168e7de5cb727 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:30:56 +0000 Subject: [PATCH] chore: sync actions from gh-aw@v0.85.1 --- setup/js/create_discussion.cjs | 2 +- setup/js/create_issue.cjs | 2 +- setup/js/create_pull_request.cjs | 2 +- setup/js/messages_footer.cjs | 5 +- setup/js/parse_antigravity_log.cjs | 127 ------------------ setup/sh/install_antigravity_cli.sh | 196 ---------------------------- 6 files changed, 7 insertions(+), 327 deletions(-) delete mode 100644 setup/js/parse_antigravity_log.cjs delete mode 100644 setup/sh/install_antigravity_cli.sh diff --git a/setup/js/create_discussion.cjs b/setup/js/create_discussion.cjs index 86c7c319..c24eb97f 100644 --- a/setup/js/create_discussion.cjs +++ b/setup/js/create_discussion.cjs @@ -587,7 +587,7 @@ async function main(config = {}) { // Generate footer with expiration using helper if (includeFooter) { const footer = addExpirationToFooter(markdownParts.footer, expiresHours, "Discussion"); - bodyLines.push(``, ``, footer); + bodyLines.push(``, footer); } // Add standalone workflow-id marker for searchability (consistent with comments) diff --git a/setup/js/create_issue.cjs b/setup/js/create_issue.cjs index 71040c66..4943252f 100644 --- a/setup/js/create_issue.cjs +++ b/setup/js/create_issue.cjs @@ -926,7 +926,7 @@ async function main(config = {}) { expiresHours, "Issue" ); - bodyLines.push(``, ``, footer); + bodyLines.push(``, footer); } // Add standalone workflow-id marker for searchability (consistent with comments) diff --git a/setup/js/create_pull_request.cjs b/setup/js/create_pull_request.cjs index f76cbf72..74c3336d 100644 --- a/setup/js/create_pull_request.cjs +++ b/setup/js/create_pull_request.cjs @@ -1595,7 +1595,7 @@ async function main(config = {}) { if (expiresHours > 0) { footer += "\n\n"; } - bodyLines.push(``, ``, footer); + bodyLines.push(``, footer); footerParts.push(footer); } diff --git a/setup/js/messages_footer.cjs b/setup/js/messages_footer.cjs index aaa0ed91..649ef7b6 100644 --- a/setup/js/messages_footer.cjs +++ b/setup/js/messages_footer.cjs @@ -736,7 +736,10 @@ function generateFooterWithMessages(workflowName, runUrl, workflowSource, workfl } // Attribution footer line comes after any guard notices - let footer = guardNotices + "\n\n" + getFooterMessage(ctx); + // Attribution footer line comes after any guard notices. Only add the separating + // blank line when guard notices are present, otherwise the footer would start with + // stray blank lines that render as a large gap after the body. + let footer = guardNotices ? guardNotices.trim() + "\n\n" + getFooterMessage(ctx) : getFooterMessage(ctx); // Add installation instructions if source is available const installMessage = getFooterInstallMessage(ctx); diff --git a/setup/js/parse_antigravity_log.cjs b/setup/js/parse_antigravity_log.cjs deleted file mode 100644 index a94ee461..00000000 --- a/setup/js/parse_antigravity_log.cjs +++ /dev/null @@ -1,127 +0,0 @@ -// @ts-check -/// - -const { createEngineLogParser, generateInformationSection, buildStepSummaryDetailsSection, convertLegacyLogEntriesToCopilotEvents } = require("./log_parser_shared.cjs"); - -const main = createEngineLogParser({ - parserName: "Antigravity", - parseFunction: parseAntigravityLog, - supportsDirectories: false, -}); - -/** - * Parse Antigravity CLI stream-json log output and format as markdown. - * Antigravity CLI emits one JSON object per line (JSONL) with the following structure: - * - Each line contains an accumulated response up to that point: - * {"response": "", "stats": {"models": {...}, "tools": {...}}} - * - Each new line supersedes the previous (the response field grows incrementally). - * - The last valid JSON line contains the complete final response and final stats. - * - * Stats structure: - * - stats.models: map of model name → {input_tokens, output_tokens} - * - stats.tools: map of tool name → call count - * - * @param {string} logContent - The raw log content to parse - * @returns {{markdown: string, logEntries: Array, mcpFailures: Array, maxTurnsHit: boolean}} Parsed log data - */ -function parseAntigravityLog(logContent) { - if (!logContent) { - return { - markdown: buildStepSummaryDetailsSection("Antigravity", "No log content provided."), - logEntries: [], - mcpFailures: [], - maxTurnsHit: false, - }; - } - - /** @type {Array<{response: string, stats: any}>} */ - const parsedLines = []; - for (const line of logContent.split("\n")) { - const trimmed = line.trim(); - if (!trimmed || !trimmed.startsWith("{")) { - continue; - } - try { - const parsed = JSON.parse(trimmed); - if (parsed && typeof parsed.response === "string") { - parsedLines.push(parsed); - } - } catch (_e) { - // Skip non-JSON lines - } - } - - if (parsedLines.length === 0) { - return { - markdown: buildStepSummaryDetailsSection("Antigravity", "Log format not recognized as Antigravity stream-json."), - logEntries: [], - mcpFailures: [], - maxTurnsHit: false, - }; - } - - // The last valid JSON line contains the complete final response and stats - const lastEntry = parsedLines[parsedLines.length - 1]; - const finalResponse = lastEntry.response || ""; - const stats = lastEntry.stats || {}; - - // Build markdown output - let markdown = buildStepSummaryDetailsSection("Antigravity", finalResponse.trim()); - - // Compute aggregated token usage from all models - let totalInputTokens = 0; - let totalOutputTokens = 0; - if (stats.models && typeof stats.models === "object") { - for (const modelStats of Object.values(stats.models)) { - if (modelStats && typeof modelStats === "object") { - const { input_tokens = 0, output_tokens = 0 } = /** @type {any} */ modelStats; - totalInputTokens += input_tokens; - totalOutputTokens += output_tokens; - } - } - } - - // Build a synthetic entry compatible with generateInformationSection - const syntheticEntry = - totalInputTokens > 0 || totalOutputTokens > 0 - ? { - usage: { - input_tokens: totalInputTokens, - output_tokens: totalOutputTokens, - }, - duration_ms: 0, - num_turns: finalResponse.trim() ? 1 : 0, - } - : null; - - markdown += generateInformationSection(syntheticEntry); - - // Build logEntries for compatibility with createEngineLogParser contract - /** @type {Array} */ - const logEntries = []; - if (finalResponse.trim()) { - logEntries.push({ - type: "assistant", - message: { - content: [{ type: "text", text: finalResponse.trim() }], - }, - }); - } - - const canonicalLogEntries = convertLegacyLogEntriesToCopilotEvents(logEntries, { sourceEngine: "antigravity" }); - - return { - markdown, - logEntries: canonicalLogEntries, - mcpFailures: [], - maxTurnsHit: false, - }; -} - -// Export for testing -if (typeof module !== "undefined" && module.exports) { - module.exports = { - main, - parseAntigravityLog, - }; -} diff --git a/setup/sh/install_antigravity_cli.sh b/setup/sh/install_antigravity_cli.sh deleted file mode 100644 index c185d6eb..00000000 --- a/setup/sh/install_antigravity_cli.sh +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env bash -set +o histexpand - -# Install Antigravity CLI (agy) from Google Cloud Storage -# Usage: install_antigravity_cli.sh VERSION [--rootless] -# -# This script downloads and installs the Antigravity CLI binary directly from -# Google Cloud Storage (https://storage.googleapis.com/antigravity-public/). -# -# Arguments: -# VERSION - Antigravity CLI version to install (required) -# --rootless - Install to ~/.local/bin without sudo; appends that directory to -# $GITHUB_PATH so subsequent steps find the binary. Use this on -# ARC/DinD runners that enforce allowPrivilegeEscalation: false. -# -# Security features: -# - Downloads binary directly from Google Cloud Storage over HTTPS -# - Verifies SHA256 checksum against official checksums.txt before installation -# - Warns and skips checksum verification if checksums.txt is unavailable (HTTP 404) -# - Fails fast if checksum verification fails -# - Fails fast on any curl errors - -set -euo pipefail - -# Configuration -GCS_BASE_URL="https://storage.googleapis.com/antigravity-public/antigravity-cli" -INSTALL_DIR="/usr/local/bin" -BINARY_NAME="agy" - -# Parse arguments: treat the first non-flag argument as VERSION, all -- arguments as flags. -VERSION="" -ROOTLESS=false -for arg in "$@"; do - case "$arg" in - --rootless) ROOTLESS=true ;; - --*) echo "WARNING: Unknown flag: $arg" >&2 ;; - *) - if [ -z "$VERSION" ]; then - VERSION="$arg" - fi - ;; - esac -done - -if [ -z "$VERSION" ]; then - echo "ERROR: Version argument is required" - echo "Usage: $0 VERSION [--rootless]" - exit 1 -fi - -# In rootless mode, install into the user's home directory instead of /usr/local/bin -# so that ARC/DinD runners with allowPrivilegeEscalation: false can run without sudo. -if [ "$ROOTLESS" = "true" ]; then - INSTALL_DIR="${HOME}/.local/bin" -fi - -# maybe_sudo runs a command with sudo unless --rootless was specified. -# In rootless mode, sudo is not available or needed. -maybe_sudo() { - if [ "$ROOTLESS" = "true" ]; then - "$@" - else - sudo "$@" - fi -} - -# Rootless mode preflight: create and verify write access to the install directory. -if [ "$ROOTLESS" = "true" ]; then - if ! { mkdir -p "${INSTALL_DIR}" && [ -w "${INSTALL_DIR}" ]; }; then - echo "ERROR: --rootless could not create a writable install directory at ${INSTALL_DIR}" >&2 - exit 1 - fi -fi - -# Detect OS and architecture -OS="$(uname -s)" -ARCH="$(uname -m)" - -# Map OS and architecture to Antigravity CLI GCS path components -case "$OS" in - Linux) - case "$ARCH" in - x86_64|amd64) ARCH_DIR="linux-x64"; TARBALL_NAME="cli_linux_x64.tar.gz" ;; - aarch64|arm64) ARCH_DIR="linux-arm"; TARBALL_NAME="cli_linux_arm64.tar.gz" ;; - *) echo "ERROR: Unsupported architecture: ${ARCH}"; exit 1 ;; - esac - ;; - Darwin) - case "$ARCH" in - x86_64|amd64) ARCH_DIR="darwin-x64"; TARBALL_NAME="cli_mac_x64.tar.gz" ;; - aarch64|arm64) ARCH_DIR="darwin-arm"; TARBALL_NAME="cli_mac_arm64.tar.gz" ;; - *) echo "ERROR: Unsupported architecture: ${ARCH}"; exit 1 ;; - esac - ;; - *) echo "ERROR: Unsupported operating system: ${OS}"; exit 1 ;; -esac - -TARBALL_URL="${GCS_BASE_URL}/${VERSION}/${ARCH_DIR}/${TARBALL_NAME}" -CHECKSUMS_URL="${GCS_BASE_URL}/${VERSION}/checksums.txt" - -echo "Installing Antigravity CLI version ${VERSION} (os: ${OS}, arch: ${ARCH})..." - -# Platform-portable SHA256 function -sha256_hash() { - local file="$1" - if command -v sha256sum &>/dev/null; then - sha256sum "$file" | awk '{print $1}' - elif command -v shasum &>/dev/null; then - shasum -a 256 "$file" | awk '{print $1}' - else - echo "ERROR: No sha256sum or shasum found" >&2 - exit 1 - fi -} - -# Create temp directory with cleanup on exit -TEMP_DIR=$(mktemp -d) -trap 'rm -rf "$TEMP_DIR"' EXIT - -# Download checksums file from GCS (if available for this version) -echo "Downloading checksums from ${CHECKSUMS_URL}..." -if ! CHECKSUMS_DOWNLOAD_STATUS=$(curl -sSL --retry 3 --retry-delay 5 -w "%{http_code}" -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"); then - echo "ERROR: Failed to download checksums.txt due to a network or TLS error" - exit 1 -fi - -VERIFY_CHECKSUM=true -if [ "${CHECKSUMS_DOWNLOAD_STATUS}" = "404" ]; then - echo "WARNING: checksums.txt not found for version ${VERSION}; skipping checksum verification." - rm -f "${TEMP_DIR}/checksums.txt" - VERIFY_CHECKSUM=false -elif [ "${CHECKSUMS_DOWNLOAD_STATUS}" != "200" ]; then - echo "ERROR: Failed to download checksums.txt (HTTP ${CHECKSUMS_DOWNLOAD_STATUS})" - exit 1 -fi - -# Download binary tarball from GCS over HTTPS -echo "Downloading from ${TARBALL_URL}..." -curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}" - -# Verify SHA256 checksum before extracting (when checksums.txt is available) -if [ "${VERIFY_CHECKSUM}" = "true" ]; then - echo "Verifying SHA256 checksum for ${TARBALL_NAME}..." - EXPECTED_CHECKSUM=$(awk -v fname="${TARBALL_NAME}" '$2 == fname {print $1; exit}' "${TEMP_DIR}/checksums.txt" | tr 'A-F' 'a-f') - - if [ -z "$EXPECTED_CHECKSUM" ]; then - echo "ERROR: Could not find checksum for ${TARBALL_NAME} in checksums.txt" - exit 1 - fi - - ACTUAL_CHECKSUM=$(sha256_hash "${TEMP_DIR}/${TARBALL_NAME}" | tr 'A-F' 'a-f') - - if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then - echo "ERROR: Checksum verification failed!" - echo " Expected: $EXPECTED_CHECKSUM" - echo " Got: $ACTUAL_CHECKSUM" - echo " The downloaded file may be corrupted or tampered with" - exit 1 - fi - - echo "✓ Checksum verification passed for ${TARBALL_NAME}" -else - echo "WARNING: Proceeding without checksum verification for ${TARBALL_NAME}" -fi - -# Extract and install binary -echo "Installing binary to ${INSTALL_DIR}/${BINARY_NAME}..." -tar -xz -C "${TEMP_DIR}" -f "${TEMP_DIR}/${TARBALL_NAME}" - -# The archive contains a binary named "antigravity" (per GCS tarball structure); -# install it as "agy" in the expected location. -if [ ! -f "${TEMP_DIR}/antigravity" ]; then - echo "ERROR: Expected binary 'antigravity' not found in the extracted archive" - exit 1 -fi -maybe_sudo install -m 755 "${TEMP_DIR}/antigravity" "${INSTALL_DIR}/${BINARY_NAME}" - -# In rootless mode, add the install dir to PATH for subsequent steps. -if [ "$ROOTLESS" = "true" ]; then - if [ -n "${GITHUB_PATH:-}" ]; then - echo "${INSTALL_DIR}" >> "${GITHUB_PATH}" - echo " Exported ${INSTALL_DIR} to GITHUB_PATH" - else - echo " GITHUB_PATH not set — binary installed at ${INSTALL_DIR}/${BINARY_NAME}" - fi -fi - -# Verify installation -echo "Verifying Antigravity CLI installation..." -if command -v "${BINARY_NAME}" >/dev/null 2>&1; then - "${BINARY_NAME}" --version || true - echo "✓ Antigravity CLI (${BINARY_NAME}) installation complete" -else - echo "ERROR: Antigravity CLI installation failed - command not found" - exit 1 -fi