Skip to content

Utility module for handling GitHub APIs from a Roblox experience

License

Notifications You must be signed in to change notification settings

boatbomber/GitHubUtil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Util

Utility module for handling GitHub APIs from a Roblox experience

Usage

local GitHubUtil = require(ServerPackages.GitHubUtil)

GitHubUtil:SetAuthToken("ghp_YOUR-KEY-HERE")

local repoSuccess, repoContent = GitHubUtil:GetRepo({
    Owner = "Roblox",
    Name = "Roact",
    Branch = "master",
}, {
    skipDotDirectories = true,
    loadLuaFiles = false,
})

API

function GitHubUtil:SetAuthToken(token: string) -> ()

Sets the auth token that will be used in requests. Must be called prior to attempting any requests.

function GitHubUtil:GetRepo(repo: RepoDetails, settings: Settings) -> (success: boolean, result: string | {})

Fetches the given repository according to the settings passed.

type RepoDetails = {
    Owner: string,
    Name: string,
    Branch: string?
}

type Settings = {
    getDepth: number? -- How many nested directories deep to query
    skipDotDirectories: boolean?, -- Exclude folders starting with .
    loadLuaFiles: boolean?, -- Put .lua files through loadstring and use their result
    loadJSONFiles: boolean?, -- Put .json file through HttpService:JSONDecode and use the resulting table
    arrayNumericNamedFiles: boolean?, -- Put 1.txt, 2.txt, ... into numeric keys instead of string
}

About

Utility module for handling GitHub APIs from a Roblox experience

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages