Pithub...:Hooks(3pm)
β¨ Pithub::Repos::Hooks β¨
okay bestie so this is Pithub::Repos::Hooks, part of the Perl user-contributed documentation, section 3pm β it's the Github v3 Repo Hooks API wrapper and honestly it's giving "small module, big power" π
VERSION: version 0.01043 π
πΈ METHODS πΈ
π¦ create
- create a hook β because why have a repo with no drama notifications, fr fr
POST /repos/:user/:repo/hooks
Examples:
my $hooks = Pithub::Repos::Hooks->new;
my $result = $hooks->create(
user => 'plu',
repo => 'Pithub',
data => {
name => 'irc',
active => 1,
config => {
server => 'irc.perl.org',
port => 6667,
room => 'pithub',
},
},
);
π delete
- delete a hook β the hook is gone, it's not coming back, periodt
DELETE /repos/:user/:repo/hooks/:id
Examples:
my $hooks = Pithub::Repos::Hooks->new;
my $result = $hooks->delete(
user => 'plu',
repo => 'Pithub',
hook_id => 5,
);
π get
- get single hook β one hook, one vibe check π
GET /repos/:user/:repo/hooks/:id
Examples:
my $hooks = Pithub::Repos::Hooks->new;
my $result = $hooks->get(
user => 'plu',
repo => 'Pithub',
hook_id => 5,
);
π«Ά list
- list Hooks β all of them, no crumbs left
GET /repos/:user/:repo/hooks
Examples:
my $hooks = Pithub::Repos::Hooks->new;
my $result = $hooks->tags( user => 'plu', repo => 'Pithub' );
okay so not me noticing that the example literally calls tags π yeah bestie, that's what's written in the docs, and we do not edit the sacred texts β copying it exactly, character for character, that's the rule π
π§ test
- get single hook β yes it says the same thing as
getup there, the docs said what the docs said, and we're keeping it π
POST /repos/:user/:repo/hooks/:id/test
Examples:
my $hooks = Pithub::Repos::Hooks->new;
my $result = $hooks->test(
user => 'plu',
repo => 'Pithub',
hook_id => 5,
);
β update
- update/edit a hook β glow-up time for your webhook β¨
PATCH /repos/:user/:repo/hooks/:id
Examples:
my $hooks = Pithub::Repos::Hooks->new;
my $result = $hooks->update(
user => 'plu',
repo => 'Pithub',
hook_id => 5,
data => {
name => 'irc',
active => 1,
config => {
server => 'irc.freenode.net',
port => 6667,
room => 'pithub',
},
},
);
π EVENTS π
Active hooks can be configured to trigger for one or more events, and the default event is push. Here's the full roster of available events β read them all, don't skim, iykyk π₯:
commit_commentβ any time a Commit is commented on.downloadβ any time a Download is added to the Repository.forkβ any time a Repository is forked.fork_applyβ any time a patch is applied to the Repository from the Fork Queue.gollumβ any time a Wiki page is updated.issuesβ any time an Issue is opened or closed.issue_commentβ any time an Issue is commented on.memberβ any time a User is added as a collaborator to a non-Organization Repository.publicβ any time a Repository changes from private to public.pull_requestβ any time a Pull Request is opened, closed, or synchronized (updated due to a new push in the branch that the pull request is tracking).pushβ any git push to a Repository.watchβ any time a User watches the Repository.
π AUTHOR π
Johannes Plunien <plu@cpan.org> β legend behaviour, no cap π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2011 by Johannes Plunien.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay π
and that's the whole page bestie β perl v5.40.1, dated 2025-06-08, and this module is Pithub...:Hooks(3pm). go forth and hook responsibly π¦
π¦ where this page comes from
- debian trixie: libpithub-perl 0.01043-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpithub-perl 0.01043-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpithub-perl 0.01043-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms