Pithub...a::Tags(3pm)

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

πŸ’– Pithub::GitData::Tags πŸ’–

okay bestie, so this is Pithub::GitData::Tags β€” it's the Github v3 Git Data Tags API, and it's documented over in the User Contributed Perl Documentation corner of the world. Yes we're reading a .3pm page, and yes it's giving very much "let me explain tags to you before you break something" energy. πŸŽ€


✨ VERSION ✨

This is version 0.01043, bestie. Write it down. πŸ’…


🌸 DESCRIPTION 🌸

okay so lowkey the most important thing here: this tags api only deals with tag objects. So it's only annotated tags, not lightweight tags. Not the light ones. The full, annotated, main-character ones. 🫢


πŸ¦‹ METHODS πŸ¦‹

⭐ create ⭐

  • Create a Tag β€” the whole vibe of this method, no cap.
Heads up bestie, and this is important: creating a tag object does not create the reference that makes a tag in Git. Read that again. πŸ“’

So if you wanna create an annotated tag in Git, you gotta do this call to create the tag object, and then create the refs/tags/[tag] reference. Two steps, bestie, two steps. 🧚

And if you want a lightweight tag? You just create the reference. That's it. This call would be straight up unnecessary. Periodt. πŸ’€

POST /repos/:user/:repo/git/tags

Parameters:

  • user: mandatory string
  • repo: mandatory string
  • data: mandatory hashref, having following keys:
    • tag: mandatory string of the tag
    • message: mandatory string of the tag message
    • object: mandatory string of the SHA of the git object this is tagging
    • type: mandatory string of the type of the object we're tagging. Normally this is a "commit" but it can also be a "tree" or a "blob".
    • tagger: mandatory hashref, having following keys:
      • name: string of the name of the author of the tag
      • email: string of the email of the author of the tag
      • date: timestamp of when this commit was tagged

Examples:

my $t = Pithub::GitData::Tags->new;
my $result = $t->create(
    user => 'plu',
    repo => 'Pithub',
    data => {
        tagger => {
            date  => '2011-06-17T14:53:35-07:00',
            email => 'schacon@gmail.com',
            name  => 'Scott Chacon',
        },
        message => 'initial version',
        object  => 'c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c',
        tag     => 'v0.0.1',
        type    => 'commit',
    }
);

Response: Status: 201 Created β€” slay, it worked. ✨

{
    "tag": "v0.0.1",
    "sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac",
    "url": "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac",
    "message": "initial version\n",
    "tagger": {
        "name": "Scott Chacon",
        "email": "schacon@gmail.com",
        "date": "2011-06-17T14:53:35-07:00"
    },
    "object": {
        "type": "commit",
        "sha": "c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c",
        "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"
    }
}

πŸ’œ get πŸ’œ

  • Get a Tag β€” the "lemme just look at this one real quick" method. πŸ”
GET /repos/:user/:repo/git/tags/:sha

Parameters:

  • user: mandatory string
  • repo: mandatory string
  • sha: mandatory string

Examples:

my $t = Pithub::GitData::Tags->new;
my $result = $t->get(
    user => 'plu',
    repo => 'Pithub',
    sha  => 'df21b2660fb6',
);

Response: Status: 200 OK β€” iconic behaviour honestly. 🌈

{
    "tag": "v0.0.1",
    "sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac",
    "url": "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac",
    "message": "initial version\n",
    "tagger": {
        "name": "Scott Chacon",
        "email": "schacon@gmail.com",
        "date": "2011-06-17T14:53:35-07:00"
    },
    "object": {
        "type": "commit",
        "sha": "c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c",
        "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"
    }
}

πŸ‘‘ AUTHOR πŸ‘‘

Johannes Plunien <plu@cpan.org> β€” the legend, the moment, the icon. πŸ’«


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. fr fr, go wild. 🫢


okay that's the whole page bestie, you're literally a tags expert now πŸ’… and for the cute sign-off: this was rendered by perl v5.40.1, dated 2025-06-08, and the page is Pithub...a::Tags(3pm). iykyk. πŸ¦‹πŸŒΈβœ¨

πŸ“¦ where this page comes from