Skip to content

Commit

Permalink
wip: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Sep 4, 2024
1 parent 664ae04 commit 14a7cb4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions forge/actions/publish/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function run() {
const project = core.getInput("project", { required: true });
const image = core.getInput("image", { required: true });

if (!imageExists(image)) {
if (imageExists(image) === false) {
core.setFailed(
`Image ${image} does not exist in the local Docker daemon`,
);
Expand All @@ -20,7 +20,7 @@ async function run() {
`Project ${project} does not have a container defined. Skipping publish`,
);
return;
} else if (blueprint?.global?.tagging?.strategy === undefined) {
} else if (blueprint?.global?.ci?.tagging?.strategy === undefined) {
core.warning(
`The repository does not have a tagging strategy defined. Skipping publish`,
);
Expand All @@ -37,7 +37,7 @@ async function run() {

const container = blueprint.project.container;
const registries = blueprint.global.registry;
const tag = getTag(blueprint.global.tagging.strategy);
const tag = getTag(blueprint.global.ci.tagging.strategy);

for (const registry of registries) {
const taggedImage = `${registry}/${container}:${tag}`;
Expand All @@ -63,11 +63,7 @@ module.exports = {
* @returns {object} The blueprint object
*/
async function getBlueprint(project) {
let result = await exec.getExecOutput("forge", [
"blueprint",
"dump",
project,
]);
let result = await exec.getExecOutput("forge", ["blueprint", "dump", project]);
return JSON.parse(result.stdout);
}

Expand Down Expand Up @@ -98,7 +94,7 @@ async function imageExists(name) {
silent: true,
});

return result.exitCode === 0;
return result === 0;
}

/***
Expand Down

0 comments on commit 14a7cb4

Please sign in to comment.