Skip to content

Commit

Permalink
Merge pull request #83 from splunk/fix/patch-set-output
Browse files Browse the repository at this point in the history
fix: patch set-output command
  • Loading branch information
mkolasinski-splunk authored Jan 3, 2023
2 parents c62f8ac + ef0e195 commit b129f52
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
submodules: recursive
persist-credentials: false
- name: Install yq
run: brew install yq
run: sudo snap install yq
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ outputs:
description: "value is success/fail based on app inspect result"
runs:
using: "docker"
image: "docker://ghcr.io/splunk/appinspect-cli-action/appinspect-cli-action:v1.5.0"
image: "Dockerfile"
10 changes: 7 additions & 3 deletions reporter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os
import sys
from pprint import pprint

Expand All @@ -19,10 +20,12 @@ def main(args):
for msg in check["messages"]:
print(msg["message"])
pprint(result["summary"])
print("::set-output name=status::pass")
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
print("status=pass", file=fh)
else:
print(f"App Inspect returned {failures} failures.")
print("::set-output name=status::fail")
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
print("status=fail", file=fh)
pprint(result["summary"])
print("Failure List:")
for group in result["reports"][0]["groups"]:
Expand All @@ -33,7 +36,8 @@ def main(args):
sys.exit(1)
else:
print("Unexpected JSON format")
print("::set-output name=status::fail")
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
print("status=fail", file=fh)
sys.exit(1)
except Exception as e:
print(f"An error occurred {str(e)}")
Expand Down

0 comments on commit b129f52

Please sign in to comment.