Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readme and contents from the Contents API #15

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/tentacles/repos.clj
Original file line number Diff line number Diff line change
Expand Up @@ -402,4 +402,16 @@
user repo event)
"hub.callback" callback}
(when-let [secret (:secret options)]
{"hub.secret" secret}))})))
{"hub.secret" secret}))})))

;; ## Repo Contents API

(defn readme
"Get the preferred README for a repository."
[user repo options]
(api-call :get "repos/%s/%s/readme" [user repo] options))

(defn contents
"Get the contents of any file or directory in a repository."
[user repo path options]
(api-call :get "repos/%s/%s/contents/%s" [user repo path] options))