Created
June 25, 2019 21:58
-
-
Save shapr/8e21f63965afb5ce2bfae6da22be6d62 to your computer and use it in GitHub Desktop.
remotely create github repo with the v3 API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import GitHub.Endpoints.Repos | |
-- https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line | |
-- give the token "public_repo" access | |
-- should be a 40 character string | |
myauth = OAuth "80....................................2e" -- magically converts to ByteString | |
mynewrepo = NewRepo { newRepoName = mkName ([] :: [Repo]) "some_repo" | |
, newRepoDescription = Just "some description" | |
, newRepoHomepage = Nothing | |
, newRepoPrivate = Just False | |
, newRepoHasIssues = Just False | |
, newRepoHasWiki = Just False | |
, newRepoAutoInit = Just True -- please create a README.md for me! | |
} | |
main :: IO () | |
main = do | |
result <- createRepo' myauth mynewrepo | |
print result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment