Pithub...:Hooks(3pm)

πŸ“¦
version 0.01043 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ 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 get up 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 🌟


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