From 215c2958a9fbde80c716ef59d7aa6644fd193313 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 03:25:19 +0000 Subject: [PATCH 1/2] Initial plan From 38a5552698c9d0d6287933f9e84b44be63bbe716 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 03:34:15 +0000 Subject: [PATCH 2/2] fix: add standardized error codes (USE-001) and staged mode emoji (USE-003) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/generate_aw_info.cjs | 6 ++++++ actions/setup/js/run_operation_update_upgrade.cjs | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/actions/setup/js/generate_aw_info.cjs b/actions/setup/js/generate_aw_info.cjs index 4974f5da22e..e561c92a393 100644 --- a/actions/setup/js/generate_aw_info.cjs +++ b/actions/setup/js/generate_aw_info.cjs @@ -4,6 +4,7 @@ const fs = require("fs"); const { TMP_GH_AW_PATH } = require("./constants.cjs"); const { generateWorkflowOverview } = require("./generate_workflow_overview.cjs"); +const { logStagedPreviewInfo } = require("./staged_preview.cjs"); const { validateContextVariables } = require("./validate_context_variables.cjs"); const validateLockdownRequirements = require("./validate_lockdown_requirements.cjs"); @@ -84,6 +85,11 @@ async function main(core, ctx) { fs.mkdirSync(TMP_GH_AW_PATH, { recursive: true }); const tmpPath = TMP_GH_AW_PATH + "/aw_info.json"; fs.writeFileSync(tmpPath, JSON.stringify(awInfo, null, 2)); + + if (awInfo.staged) { + logStagedPreviewInfo("Generating workflow info in staged mode — no changes applied"); + } + core.info("Generated aw_info.json at: " + tmpPath); core.info(JSON.stringify(awInfo, null, 2)); diff --git a/actions/setup/js/run_operation_update_upgrade.cjs b/actions/setup/js/run_operation_update_upgrade.cjs index bd36efa89f0..2c761c5c2d0 100644 --- a/actions/setup/js/run_operation_update_upgrade.cjs +++ b/actions/setup/js/run_operation_update_upgrade.cjs @@ -2,6 +2,7 @@ /// const { getErrorMessage } = require("./error_helpers.cjs"); +const { ERR_CONFIG, ERR_SYSTEM } = require("./error_codes.cjs"); /** * Format a UTC Date as YYYY-MM-DD-HH-MM-SS for use in branch names. @@ -49,7 +50,7 @@ async function main() { core.info(`Running: ${fullCmd}`); const exitCode = await exec.exec(bin, [...prefixArgs, operation]); if (exitCode !== 0) { - throw new Error(`Command '${fullCmd}' failed with exit code ${exitCode}`); + throw new Error(`${ERR_SYSTEM}: Command '${fullCmd}' failed with exit code ${exitCode}`); } core.info(`✓ All agentic workflows have been ${operation}d`); return; @@ -72,7 +73,7 @@ async function main() { core.info(`Running: ${fullCmd}`); const exitCode = await exec.exec(bin, [...prefixArgs, operation]); if (exitCode !== 0) { - throw new Error(`Command '${fullCmd}' failed with exit code ${exitCode}`); + throw new Error(`${ERR_SYSTEM}: Command '${fullCmd}' failed with exit code ${exitCode}`); } // Check for changed files @@ -154,7 +155,7 @@ async function main() { const repo = context.repo.repo; const token = process.env.GH_TOKEN || process.env.GITHUB_TOKEN; if (!token) { - throw new Error("Missing GitHub token: set GH_TOKEN or GITHUB_TOKEN to push changes and create a pull request for agentic workflow update/upgrade operations."); + throw new Error(`${ERR_CONFIG}: Missing GitHub token: set GH_TOKEN or GITHUB_TOKEN to push changes and create a pull request for agentic workflow update/upgrade operations.`); } const githubServerUrl = process.env.GITHUB_SERVER_URL || "https://github.com"; let githubHost;