You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: rename --approve-updates to --approve and skip safe update enforcement on first compile (#26350)
* fix: rename --approve-updates to --approve and skip safe update enforcement on first compile
- Rename --approve-updates flag to --approve in compile, run, and upgrade commands
- Change first-compile behavior: skip enforcement when no prior manifest exists
instead of flagging all new secrets/actions (baseline is created silently)
- Update remediation message to reference --approve instead of --approve-updates
- Update all tests to reflect new first-compile behavior
* fix: enforce safe update on first compile (no lock file), skip only for legacy lock files without manifest
Distinguish between two nil-manifest cases:
- No lock file exists (new workflow): pass &GHAWManifest{} (empty non-nil) to
EnforceSafeUpdate so all new secrets/actions are flagged for review
- Lock file exists without a gh-aw-manifest section (legacy): pass nil to
EnforceSafeUpdate which skips enforcement
This restores SECURITY REVIEW REQUIRED warnings on first compilation while
still allowing legacy lock files to upgrade without false positives.
@@ -694,7 +694,7 @@ Use "` + string(constants.CLIExtensionPrefix) + ` help all" to show help for all
694
694
compileCmd.Flags().Bool("fail-fast", false, "Stop at the first validation error instead of collecting all errors")
695
695
compileCmd.Flags().Bool("no-check-update", false, "Skip checking for gh-aw updates")
696
696
compileCmd.Flags().String("schedule-seed", "", "Override the repository slug (owner/repo) used as seed for fuzzy schedule scattering (e.g. 'github/gh-aw'). Bypasses git remote detection entirely. Use this when your git remote is not named 'origin' and you have multiple remotes configured")
697
-
compileCmd.Flags().Bool("approve-updates", false, "Approve all safe update changes. When strict mode is active (the default), the compiler emits warnings for new restricted secrets or unapproved action additions/removals not present in the existing gh-aw-manifest. Use this flag to approve and skip safe update enforcement")
697
+
compileCmd.Flags().Bool("approve", false, "Approve all safe update changes. When strict mode is active (the default), the compiler emits warnings for new restricted secrets or unapproved action additions/removals not present in the existing gh-aw-manifest. Use this flag to approve and skip safe update enforcement")
698
698
compileCmd.Flags().Bool("validate-images", false, "Require Docker to be available for container image validation. Without this flag, container image validation is silently skipped when Docker is not installed or the daemon is not running")
699
699
compileCmd.Flags().String("prior-manifest-file", "", "Path to a JSON file containing pre-cached gh-aw-manifests (map[lockFile]*GHAWManifest); used by the MCP server to supply a tamper-proof manifest baseline captured at startup")
// regardless of the workflow's strict mode setting.
161
161
compiler.SetApprove(config.Approve)
162
162
ifconfig.Approve {
163
-
compileCompilerSetupLog.Print("Safe update changes approved via --approve-updates flag: skipping safe update enforcement for new restricted secrets or unapproved action additions/removals")
163
+
compileCompilerSetupLog.Print("Safe update changes approved via --approve flag: skipping safe update enforcement for new restricted secrets or unapproved action additions/removals")
164
164
}
165
165
166
166
// Set require docker flag: when set, container image validation fails instead of
log.Printf("Failed to parse filesystem gh-aw-manifest: %v. Safe update enforcement will treat as empty manifest.", parseErr)
719
719
}
720
720
} else {
721
-
log.Printf("Lock file %s not found on filesystem either (new workflow or not yet written). Safe update enforcement will treat as empty manifest.", lockFile)
721
+
// No lock file anywhere — this is a brand-new workflow. Use an empty
722
+
// (non-nil) manifest so EnforceSafeUpdate applies enforcement and flags
723
+
// any newly introduced secrets or actions for review.
724
+
log.Printf("Lock file %s not found (new workflow). Safe update enforcement will use an empty baseline.", lockFile)
sb.WriteString("\n\nRemediation options:\n 1. Use the --approve-updates flag to allow the changes.\n 2. Revert the unapproved changes.\n 3. Use an interactive coding agent to review and approve the changes.")
218
+
sb.WriteString("\n\nRemediation options:\n 1. Use the --approve flag to allow the changes.\n 2. Revert the unapproved changes.\n 3. Use an interactive coding agent to review and approve the changes.")
0 commit comments