config

package
v0.3.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionName added in v0.3.22

type ActionName string
const (
	ActionAggregateReleases           ActionName = "aggregate-releases"
	ActionYAMLTranslateReleases       ActionName = "yaml-translate-releases"
	ActionLabelsOnIssueCreation       ActionName = "labels-on-issue-creation"
	ActionCreateRepositoryMaintainers ActionName = "create-repository-maintainers"
	ActionDistributeReleases          ActionName = "distribute-releases"
	ActionReleaseDraft                ActionName = "release-draft"
	ActionIssueCommentsHandler        ActionName = "issue-handling"
	ActionProjectItemAddHandler       ActionName = "add-items-to-project"
	ActionProjectV2ItemHandler        ActionName = "project-v2-item"
)

type AggregateReleasesConfig added in v0.3.4

type AggregateReleasesConfig struct {
	TargetRepositoryName string                 `mapstructure:"repository" description:"the name of the target repo"`
	TargetRepositoryURL  string                 `mapstructure:"repository-url" description:"the url of the target repo"`
	Branch               *string                `mapstructure:"branch" description:"the branch to push in the target repo"`
	BranchBase           *string                `mapstructure:"branch-base" description:"the base branch to raise the pull request against"`
	CommitMsgTemplate    *string                `mapstructure:"commit-tpl" description:"template of the commit message"`
	PullRequestTitle     *string                `mapstructure:"pull-request-title" description:"title of the pull request"`
	SourceRepos          map[string]RepoActions `mapstructure:"repos" description:"the source repositories to trigger this action"`
}

type Client

type Client struct {
	GitlabAuthConfig *GitlabClient `json:"gitlab" description:"auth config a gitlab client"`
	GithubAuthConfig *GithubClient `json:"github" description:"auth config a github client"`
	Name             string        `json:"name" description:"name of the client, used for referencing in webhook config"`
	OrganizationName string        `json:"organization" description:"name of the organization that this client will act on"`
}

type Configuration

type Configuration struct {
	Clients  []Client  `json:"clients" description:"client configurations"`
	Webhooks []Webhook `json:"webhooks" description:"webhook configurations"`
	Raw      []byte
}

func New

func New(configPath string) (*Configuration, error)

type DistributeReleasesConfig added in v0.3.4

type DistributeReleasesConfig struct {
	SourceRepositoryName string       `mapstructure:"repository" description:"the name of the source repo"`
	SourceRepositoryURL  string       `mapstructure:"repository-url" description:"the url of the source repo"`
	BranchTemplate       *string      `mapstructure:"branch-template" description:"the branch to push in the target repos"`
	CommitMsgTemplate    *string      `mapstructure:"commit-tpl" description:"template of the commit message in the target repos"`
	PullRequestTitle     *string      `mapstructure:"pull-request-title" description:"title of the pull request"`
	TargetRepos          []TargetRepo `mapstructure:"repos" description:"the repositories that will be updated"`
}

type GithubClient

type GithubClient struct {
	AppID              int64  `json:"app-id" description:"application id of github app"`
	PrivateKeyCertPath string `json:"key-path" description:"private key pem path of github app"`
}

type GitlabClient

type GitlabClient struct {
	Token string `json:"token" description:"auth token for gitlab client"`
}

type IssueCommentsHandlerConfig added in v0.3.20

type IssueCommentsHandlerConfig struct{}

type LabelsOnCreation added in v0.3.22

type LabelsOnCreation struct {
	SourceRepos map[string]RepoActions `mapstructure:"repos" description:"the source repositories to trigger this action"`
}

type LinePatchConfig

type LinePatchConfig struct {
	File            string  `mapstructure:"file" description:"the name of the file to be patched"`
	Line            int     `mapstructure:"line" description:"the line number in the file to be patched"`
	ReplaceTemplate *string `mapstructure:"template" description:"a special template to be used for patching the line"`
}

type Modifier

type Modifier struct {
	Type string         `json:"type" description:"name of the modifier"`
	Args map[string]any `json:"args" description:"modifier configuration"`
}

type ProjectItemAddHandlerConfig added in v0.3.20

type ProjectItemAddHandlerConfig struct {
	ProjectID        string  `mapstructure:"project-id" description:"the project in which to move newly created issues and pull requests"`
	IssuesTypeFilter *string `mapstructure:"issue-type" description:"type of the issue to add"`
}

type ProjectV2ItemHandlerConfig added in v0.3.22

type ProjectV2ItemHandlerConfig struct {
	ProjectID    string   `mapstructure:"project-id" description:"the project on which to handle item events"`
	RemoveLabels []string `` /* 128-byte string literal not displayed */
}

type ReleaseDraftConfig added in v0.3.4

type ReleaseDraftConfig struct {
	Repos                map[string]any `mapstructure:"repos" description:"the repositories for that a release draft will be pushed"`
	RepositoryName       string         `mapstructure:"repository" description:"the name of the release repo"`
	Branch               *string        `mapstructure:"branch" description:"the branch considered for releases"`
	BranchBase           *string        `mapstructure:"branch-base" description:"the base branch to raise the pull request against"`
	ReleaseTitleTemplate *string        `mapstructure:"title-template" description:"custom template for the release title"`
	DraftHeadline        *string        `mapstructure:"draft-headline" description:"custom headline for the release draft"`

	MergedPRsHeadline    *string `mapstructure:"merged-prs-section-headline" description:"custom headline for the section of merged pull requests"`
	MergedPRsDescription *string `mapstructure:"merged-prs-section-description" description:"description for the merged pull requests section"`
}

type RepoActions added in v0.3.22

type RepoActions struct {
	Modifiers []Modifier `mapstructure:"modifiers" description:"the modifiers of this repo action"`
	Labels    []string   `mapstructure:"labels" description:"the labels to act on with this repo action"`
}

type RepositoryMaintainersConfig

type RepositoryMaintainersConfig struct {
	Suffix                *string `mapstructure:"suffix" description:"suffix for maintainers group"`
	AdditionalMemberships []struct {
		TeamSlug   string `mapstructure:"team" description:"the slug of the team"`
		Permission string `mapstructure:"permission" description:"the permission for the team, must be one of "`
	} `mapstructure:"additional-teams" description:"adds additional teams to this repository"`
}

type TargetRepo added in v0.3.4

type TargetRepo struct {
	RepositoryName string     `mapstructure:"repository" description:"the name of the target repo"`
	RepositoryURL  string     `mapstructure:"repository-url" description:"the name of the target repo"`
	Branch         string     `mapstructure:"branch" description:"the branch of the target repo to act on, defaults to master"`
	Patches        []Modifier `mapstructure:"modifiers" description:"the name of the target repo"`
}

type VCSType

type VCSType string
const (
	Github VCSType = "github"
	Gitlab VCSType = "gitlab"
)

type Webhook

type Webhook struct {
	VCS       VCSType        `json:"vcs" description:"type of the vcs"`
	ServePath string         `json:"serve-path" description:"path of the webhook to serve on"`
	Secret    string         `json:"secret" description:"the webhook secret"`
	Actions   WebhookActions `json:"actions" description:"webhook actions"`
}

type WebhookAction

type WebhookAction struct {
	Type   ActionName     `json:"type" description:"name of the webhook action"`
	Client string         `json:"client" description:"client that this webhook action uses"`
	Args   map[string]any `json:"args" description:"action configuration"`
}

type WebhookActions

type WebhookActions []WebhookAction

func (WebhookActions) String

func (w WebhookActions) String() string

type YAMLPathPatchConfig

type YAMLPathPatchConfig struct {
	File           string  `mapstructure:"file" description:"the name of the file to be patched"`
	YAMLPath       string  `mapstructure:"yaml-path" description:"the yaml path to the version"`
	Template       *string `mapstructure:"template" description:"a special template to be used for patching the version"`
	VersionCompare *bool   `` /* 143-byte string literal not displayed */
}

type YAMLTranslateReleasesConfig added in v0.3.4

type YAMLTranslateReleasesConfig struct {
	TargetRepositoryName string                       `mapstructure:"repository" description:"the name of the target repo"`
	TargetRepositoryURL  string                       `mapstructure:"repository-url" description:"the url of the target repo"`
	Branch               *string                      `mapstructure:"branch" description:"the branch to push in the target repo"`
	BranchBase           *string                      `mapstructure:"branch-base" description:"the base branch to raise the pull request against"`
	CommitMsgTemplate    *string                      `mapstructure:"commit-tpl" description:"template of the commit message"`
	PullRequestTitle     *string                      `mapstructure:"pull-request-title" description:"title of the pull request"`
	SourceRepos          map[string][]YAMLTranslation `mapstructure:"repos" description:"the source repositories to trigger this action"`
}

type YAMLTranslation added in v0.3.4

type YAMLTranslation struct {
	From YAMLTranslationRead `mapstructure:"from" description:"the yaml path from where to read the replacement value"`
	To   []Modifier          `mapstructure:"to" description:"the actions to take on the target repo with the read the replacement value"`
}

type YAMLTranslationRead added in v0.3.4

type YAMLTranslationRead struct {
	File     string `mapstructure:"file" description:"the name of the file to be patched"`
	YAMLPath string `mapstructure:"yaml-path" description:"the yaml path to the version"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL