Tying up loose ends (#54)

* various qol updates to publish action

* review comments and run bundle
This commit is contained in:
Conor Sloan
2024-02-02 13:02:14 -05:00
committed by Edwin Sirko
parent 3c4259bfdd
commit 1f47b19ed3
23 changed files with 811 additions and 514 deletions
Generated Vendored
+27
View File
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getContainerRegistryURL = exports.getRepositoryMetadata = void 0;
async function getRepositoryMetadata(repository, token) {
const response = await fetch(`${process.env.GITHUB_API_URL}/repos/${repository}`);
if (!response.ok) {
throw new Error(`Failed to fetch repository metadata: ${response.statusText}`);
}
const data = await response.json();
// Check that the response contains the expected data
if (!data.id || !data.owner.id) {
throw new Error(`Failed to fetch repository metadata: ${JSON.stringify(data)}`);
}
return { repoId: data.id, ownerId: data.owner.id };
}
exports.getRepositoryMetadata = getRepositoryMetadata;
async function getContainerRegistryURL() {
const response = await fetch(`${process.env.GITHUB_API_URL}/packages/container-registry-url`);
if (!response.ok) {
throw new Error(`Failed to fetch status page: ${response.statusText}`);
}
const data = await response.json();
const registryURL = new URL(data.url);
return registryURL;
}
exports.getContainerRegistryURL = getContainerRegistryURL;
//# sourceMappingURL=api-client.js.map