Documentation
¶
Overview ¶
Package gitea implements providers.Provider for Gitea Actions.
Gitea Actions uses the same workflow syntax as GitHub Actions but runs jobs via act_runner, which embeds nektos/act and talks to the Gitea instance over ConnectRPC (Register, Declare, FetchTask, UpdateTask, UpdateLog).
Integration model (embed binary):
ephemerd polls for tasks via the ConnectRPC FetchTask endpoint. When a job arrives, ephemerd spins up a container from the default runner image (which has act_runner pre-installed) and launches: act_runner daemon --ephemeral with the runner config pre-seeded (instance URL, token, labels). The runner handles workflow execution, log streaming, and status reporting. ephemerd manages the container lifecycle.
Gitea vs Forgejo:
While the protocol is nearly identical (both ConnectRPC, same 5 RPCs), the proto packages and runner binaries have diverged: - Gitea: act_runner / code.gitea.io/actions-proto-go - Forgejo: forgejo-runner / code.forgejo.org/forgejo/actions-proto - Gitea uses --ephemeral flag; Forgejo uses dedicated one-job command
Reference:
- Runner source: https://gitea.com/gitea/act_runner
- Runner proto: https://gitea.com/gitea/actions-proto-def
- API docs: https://docs.gitea.com/usage/actions/overview
Index ¶
- type Config
- type Provider
- func (p *Provider) ClaimJob(ctx context.Context, event *providers.JobEvent, runnerName string, ...) (*providers.Claim, error)
- func (p *Provider) DefaultImage() string
- func (p *Provider) DefaultImageFor(os string) string
- func (p *Provider) DefaultJobImage() string
- func (p *Provider) FetchJobImage(ctx context.Context, event *providers.JobEvent) string
- func (p *Provider) Name() string
- func (p *Provider) ReleaseJob(ctx context.Context, claim *providers.Claim) error
- func (p *Provider) Start(ctx context.Context, cfg providers.PollConfig) (<-chan providers.JobEvent, error)
- func (p *Provider) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// InstanceURL is the base URL of the Gitea instance (e.g., "https://gitea.example.com").
InstanceURL string
// Token is the runner registration token from the Gitea admin panel.
// Found at: Site Administration > Actions > Runners > Create new runner.
Token string
// Owner is the organization or user that owns the runner.
// If empty, the runner is registered at the instance level.
Owner string
// Repos limits the runner to specific repositories.
// If empty, the runner accepts jobs from all repos the owner has access to.
Repos []string
// Labels are the runner labels to register with the forge.
// Each label is a string like "ubuntu-latest:docker://image:tag".
// If empty, defaults to ["ubuntu-latest:docker://<job_image>"].
Labels []string
// DefaultImage is the legacy single-image override for the runner
// daemon container (Linux). Prefer LinuxImage / WindowsImage.
// Default: "docker.io/gitea/act_runner:latest"
DefaultImage string
// LinuxImage / WindowsImage override the runner daemon image per job OS.
LinuxImage string
WindowsImage string
// JobImage is the default OCI image for job execution containers.
// The runner daemon creates job containers via the fake Docker socket;
// this image is what those containers run.
// Default: "docker.io/gitea/runner-images:ubuntu-24.04"
JobImage string
// HTTPClient is an optional *http.Client for the ConnectRPC client.
// If nil, a default client with 30s timeout is used.
HTTPClient *http.Client
Log *slog.Logger
}
Config for the Gitea provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements providers.Provider for Gitea Actions.
func (*Provider) DefaultImage ¶
func (*Provider) DefaultImageFor ¶
DefaultImageFor returns the runner-daemon image for the given job OS. Gitea's act_runner is Linux-only upstream; Windows override is honored for callers that ship a custom build.
func (*Provider) DefaultJobImage ¶
func (*Provider) FetchJobImage ¶
func (*Provider) ReleaseJob ¶
Click to show internal directories.
Click to hide internal directories.