Implement tag api. #145. #155

merged 1 commit into from Oct 15, 2012

3 participants

octokit member

Adds .tag and .create_tag methods.

The create method uses a lot of parameters, would a hash be better suited for this? I went with required fields as params since thats what it feels like the rest of octokit uses.

Also the tags created with this seem to be invisible. I created a tag on a private repo and I can retrieve the tag with the sha I get when creating it, but it doesn't show up anywhere and can't be used for anything I can see. The tags don't show up on the GitHub repo page. Pulling the repo from GitHub doesn't mention the creation of any new tags either.

@joeyw joeyw Implement tag api. #145.
implement .tag
implement .create_tag
@pengwynn pengwynn merged commit 1426822 into octokit:master Oct 15, 2012

1 check passed

Details default The Travis build passed

Just sharing my experience:

I ended up using Octokit::Client#post directly because, although not documented, if tagger param is not present, Github API seems to assume the tagger is the authenticated user with date now. It's so much more convenient that way for most cases.

This is what I do now:

    # Octokit::Client#create_tag requires specifying tagger.
    # If tagger is not specified in the options, Github API automatically uses the authenticated user and current date.
    def octokit_client_create_tag2(repo, tag, message, object_sha, type, options = {})
        tag: tag,
        message: message,
        object: object_sha,
        type: type
      )"#{Octokit::Repository.path(repo)}/git/tags", options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment