Convenience functions for the GitHub repository Contents REST API (reading and writing files).
Thin wrappers over GhEx.REST that return the same {:ok, body, meta} /
{:error, reason} shape; opts pass through to Req. The write endpoints
take the GitHub body as-is: content must be Base64-encoded, and an update
needs the blob sha.
Summary
Functions
Creates or updates a file. attrs is the JSON body: message, content
(Base64-encoded), sha (required when updating an existing file), and an
optional branch.
Deletes a file. attrs is the JSON body: message, the blob sha, and an
optional branch.
Gets the contents of a file or directory. Use params: [ref: "..."] to select
a branch, tag, or commit.
Functions
@spec create_or_update_file( GhEx.Client.t(), String.t(), String.t(), String.t(), map(), keyword() ) :: GhEx.REST.result()
Creates or updates a file. attrs is the JSON body: message, content
(Base64-encoded), sha (required when updating an existing file), and an
optional branch.
@spec delete_file( GhEx.Client.t(), String.t(), String.t(), String.t(), map(), keyword() ) :: GhEx.REST.result()
Deletes a file. attrs is the JSON body: message, the blob sha, and an
optional branch.
@spec get(GhEx.Client.t(), String.t(), String.t(), String.t(), keyword()) :: GhEx.REST.result()
Gets the contents of a file or directory. Use params: [ref: "..."] to select
a branch, tag, or commit.