diff --git a/cmd/plugin/main.go b/cmd/plugin/main.go index c6bdcc6..4723fb2 100644 --- a/cmd/plugin/main.go +++ b/cmd/plugin/main.go @@ -14,12 +14,15 @@ import ( semrelplugin "github.com/SemRels/provider-git/internal/plugin" ) +const pluginSchemaVersion = 1 + type gitClient interface { PushTag(ctx context.Context, tagName, remote string) error PushBranch(ctx context.Context, branch, remote string) error } func main() { + fmt.Fprintf(os.Stderr, "plugin_schema_version=%d\n", pluginSchemaVersion) if err := run(context.Background(), os.Getenv, os.Stdout, semrelplugin.NewClient(semrelplugin.ConfigFromEnv(os.Getenv), semrelplugin.ExecRunner{})); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) diff --git a/schema/v1.json b/schema/v1.json new file mode 100644 index 0000000..5399574 --- /dev/null +++ b/schema/v1.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://registry.semrel.io/schemas/plugins/provider-git/v1.json", + "title": "provider-git plugin configuration", + "description": "Schema v1 for the provider-git semrel plugin. Configure via SEMREL_* environment variables.", + "type": "object", + "properties": { + "SEMREL_TAG_NAME": { + "type": "string", + "description": "Release tag name for the current semrel execution." + }, + "SEMREL_BRANCH": { + "type": "string", + "description": "Release branch name for the current semrel execution." + }, + "SEMREL_PLUGIN_REMOTE": { + "type": "string", + "default": "origin", + "description": "Git remote to push to." + }, + "SEMREL_REMOTE": { + "type": "string", + "default": "origin", + "description": "Fallback git remote name used when SEMREL_PLUGIN_REMOTE is unset." + }, + "SEMREL_DRY_RUN": { + "type": "string", + "enum": [ + "true", + "false", + "1", + "0" + ], + "default": "false", + "description": "When true, perform validation and logging only without executing side effects." + } + }, + "additionalProperties": true +}