github

package module
v0.0.0-...-12ddd8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 7 Imported by: 0

README

go-actions-toolkit/github


Installation

go get github.com/jcbhmr/go-actions-toolkit/github

Usage

package main

import (
    "fmt"

    "github.com/jcbhmr/go-actions-toolkit/github"
)

func main() {
    repo, _ := github.Context.Repo()
    fmt.Printf("This is the %s/%s repository", repo.Owner, repo.Repo)
    // Output: This is the jcbhmr/go-actions-toolkit repository
}

Development

Documentation

Overview

Example
token := os.Getenv("GITHUB_TOKEN")
client := unwrap1(github.GetGoGithubClient(token))
repo := github.Context.Repo()
info, _ := unwrap2(client.Repositories.Get(context.Background(), repo.Owner, repo.Repo))
fmt.Printf("info.GetFullName()=%s\n", info.GetFullName())
fmt.Printf("info.GetDescription()=%s\n", info.GetDescription())
Output:

info.GetFullName()=jcbhmr/actions-toolkit.go
info.GetDescription()=🐿️ GitHub Actions toolkit for your Go-based GitHub Actions

Index

Examples

Constants

This section is empty.

Variables

View Source
var Context = newContext()

Functions

func GetClient

func GetClient(token string) (*gogithubgithub.Client, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL