resonance 1.0.1
Loading...
Searching...
No Matches
Tools::BuildImage::GitHubClient Class Reference

Client of the GitHub Actions API for the build artifacts of one repository. More...

#include <githubclient.h>

Public Member Functions

 GitHubClient (std::string repo, std::string token)
 Create a client.
std::expected< std::uint64_t, Error > latestSuccessfulRun () const
 Identify the latest successful run of the build workflow.
std::expected< std::vector< std::uint8_t >, Error > downloadArtifact (std::uint64_t runId, const std::string &artifact) const
 Fetch one artifact archive from a run.

Detailed Description

Client of the GitHub Actions API for the build artifacts of one repository.

Constructor & Destructor Documentation

◆ GitHubClient()

Tools::BuildImage::GitHubClient::GitHubClient ( std::string repo,
std::string token )

Create a client.

Parameters
repoRepository in owner and name form.
tokenBearer token for the requests.

Member Function Documentation

◆ latestSuccessfulRun()

std::expected< std::uint64_t, Error > Tools::BuildImage::GitHubClient::latestSuccessfulRun ( ) const
nodiscard

Identify the latest successful run of the build workflow.

Returns
Run identifier, or an error when the request fails or no successful run exists.

◆ downloadArtifact()

std::expected< std::vector< std::uint8_t >, Error > Tools::BuildImage::GitHubClient::downloadArtifact ( std::uint64_t runId,
const std::string & artifact ) const
nodiscard

Fetch one artifact archive from a run.

Parameters
runIdActions run with the artifact.
artifactArtifact name.
Returns
Archive bytes, or an error when the request fails or the artifact is missing or expired.

The documentation for this class was generated from the following file: