Update installed plugins. Check for available updates: ggshield plugin update --check Update a specific plugin: ggshield plugin update tokenscanner Update all installed plugins: ggshield plugin update --all Note: Only plugins from GitGuardian API a
(
ctx: click.Context,
plugin_name: Optional[str],
update_all: bool,
check_only: bool,
allow_unsigned: bool,
**kwargs: Any,
)
| 87 | @add_common_options() |
| 88 | @click.pass_context |
| 89 | def update_cmd( |
| 90 | ctx: click.Context, |
| 91 | plugin_name: Optional[str], |
| 92 | update_all: bool, |
| 93 | check_only: bool, |
| 94 | allow_unsigned: bool, |
| 95 | **kwargs: Any, |
| 96 | ) -> None: |
| 97 | """ |
| 98 | Update installed plugins. |
| 99 | |
| 100 | Check for available updates: |
| 101 | |
| 102 | ggshield plugin update --check |
| 103 | |
| 104 | Update a specific plugin: |
| 105 | |
| 106 | ggshield plugin update tokenscanner |
| 107 | |
| 108 | Update all installed plugins: |
| 109 | |
| 110 | ggshield plugin update --all |
| 111 | |
| 112 | Note: Only plugins from GitGuardian API and GitHub releases can be auto-updated. |
| 113 | Plugins installed from local files or GitHub artifacts cannot be auto-updated. |
| 114 | """ |
| 115 | if not plugin_name and not update_all and not check_only: |
| 116 | ui.display_error("Please specify a plugin name, use --all, or use --check") |
| 117 | ui.display_info("Usage: ggshield plugin update <plugin_name>") |
| 118 | ui.display_info(" ggshield plugin update --all") |
| 119 | ui.display_info(" ggshield plugin update --check") |
| 120 | ctx.exit(ExitCode.USAGE_ERROR) |
| 121 | |
| 122 | ctx_obj = ContextObj.get(ctx) |
| 123 | config = ctx_obj.config |
| 124 | |
| 125 | # Signature verification is strict by default. The only override is the |
| 126 | # explicit per-command --allow-unsigned flag. |
| 127 | enterprise_config = EnterpriseConfig.load() |
| 128 | signature_mode = ( |
| 129 | SignatureVerificationMode.WARN |
| 130 | if allow_unsigned |
| 131 | else SignatureVerificationMode.STRICT |
| 132 | ) |
| 133 | loader = PluginLoader(enterprise_config) |
| 134 | downloader = PluginDownloader() |
| 135 | |
| 136 | installed_plugins = {p.name: p for p in loader.discover_plugins() if p.is_installed} |
| 137 | |
| 138 | # Determine which plugins to check/update |
| 139 | if update_all or check_only: |
| 140 | plugins_to_process = list(installed_plugins.keys()) |
| 141 | else: |
| 142 | if plugin_name not in installed_plugins: |
| 143 | ui.display_error(f"Plugin '{plugin_name}' is not installed") |
| 144 | ui.display_info("Use 'ggshield plugin list' to see installed plugins") |
| 145 | ctx.exit(ExitCode.USAGE_ERROR) |
| 146 | plugins_to_process = [plugin_name] |
nothing calls this directly
no test coverage detected