Client of the GitHub Actions API for the build artifacts of one repository.
More...
#include <githubclient.h>
|
| | 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.
|
Client of the GitHub Actions API for the build artifacts of one repository.
◆ GitHubClient()
| Tools::BuildImage::GitHubClient::GitHubClient |
( |
std::string | repo, |
|
|
std::string | token ) |
Create a client.
- Parameters
-
| repo | Repository in owner and name form. |
| token | Bearer token for the requests. |
◆ 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
-
| runId | Actions run with the artifact. |
| artifact | Artifact 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: