NAME

WWW::Gitea::API::Repos - Gitea repositories API

VERSION

version 0.001

SYNOPSIS

my $repo = $gitea->repos->get('getty', 'p5-www-gitea');

my $new = $gitea->repos->create(
    name      => 'my-repo',
    private   => 1,
    auto_init => 1,
);

my @hits = @{ $gitea->repos->search(q => 'gitea', limit => 5) };

DESCRIPTION

Controller for the Gitea repositories API. Reached via $gitea->repos.

client

The parent WWW::Gitea client providing HTTP transport.

openapi_operations

Pre-computed operation table (operationId{method, path}).

get

my $repo = $gitea->repos->get('getty', 'p5-www-gitea');

Fetches a repository by owner and name. Returns a WWW::Gitea::Repo.

create

# In the authenticated user's namespace
my $repo = $gitea->repos->create(
    name        => 'my-repo',
    description => '...',
    private     => 1,
    auto_init   => 1,
    default_branch => 'main',
);

# In an organization
my $repo = $gitea->repos->create(org => 'myorg', name => 'my-repo');

Creates a repository. With org it is created under that organization (POST /orgs/{org}/repos), otherwise under the authenticated user (POST /user/repos). All other arguments are passed through to Gitea as the JSON body. Returns a WWW::Gitea::Repo.

edit

my $repo = $gitea->repos->edit('getty', 'p5-www-gitea',
    description => 'new description',
    archived    => \1,
);

Edits a repository. Arguments are passed through as the JSON body. Returns the updated WWW::Gitea::Repo.

delete

$gitea->repos->delete('getty', 'old-repo');

Deletes a repository. Returns a true value on success.

my $repos = $gitea->repos->search(q => 'gitea', limit => 10);

Searches repositories. Accepts the Gitea query parameters (q, topic, sort, order, private, archived, page, limit, ...). Returns an ArrayRef of WWW::Gitea::Repo objects.

fork

my $fork = $gitea->repos->fork('getty', 'p5-www-gitea');
my $fork = $gitea->repos->fork('getty', 'p5-www-gitea',
    organization => 'myorg', name => 'my-fork');

Forks a repository. Optional body arguments (organization, name) are passed through. Returns the new fork as a WWW::Gitea::Repo.

list

my $mine   = $gitea->repos->list;                       # authenticated user
my $theirs = $gitea->repos->list(username => 'getty');  # another user

Lists repositories. Without username it lists the authenticated user's repos (GET /user/repos); with username it lists that user's public repos (GET /users/{username}/repos). Remaining arguments (page, limit) become query parameters. Returns an ArrayRef of WWW::Gitea::Repo.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://codeberg.org/getty/p5-www-gitea/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.