Skip to content

Commit

Permalink
Print matrix data
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Sep 21, 2023
1 parent c477ccd commit cb37c73
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import json
import os
import pprint
import sys

import jinja2.sandbox
Expand Down Expand Up @@ -196,15 +197,16 @@ def matrix(ctx, image, from_workflow=False):
}
)

ctx.warn("Generated Matrix:")
print(pprint.pformat(output), flush=True, file=sys.stdout)

if from_workflow:
github_output = os.environ.get("GITHUB_OUTPUT")
if github_output is None:
ctx.warn("The 'GITHUB_OUTPUT' variable is not set.")
utils.exit_invoke(1)
with open(github_output, "a", encoding="utf-8") as wfh:
wfh.write(f"dockerinfo={json.dumps(output)}\n")
else:
print(json.dumps(output), flush=True, file=sys.stdout)


@task
Expand Down

0 comments on commit cb37c73

Please sign in to comment.