Skip to content

Commit

Permalink
action: remove deprecated use of set-output (#29)
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <william@trailofbits.com>

Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw committed Nov 3, 2022
1 parent 2e33274 commit 5ed8d31
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions action.py
Expand Up @@ -15,7 +15,8 @@
_HERE = Path(__file__).parent.resolve()
_TEMPLATES = _HERE / "templates"

_SUMMARY = Path(os.getenv("GITHUB_STEP_SUMMARY")).open("a")
_GITHUB_STEP_SUMMARY = Path(os.getenv("GITHUB_STEP_SUMMARY")).open("a")
_GITHUB_OUTPUT = Path(os.getenv("GITHUB_OUTPUT")).open("a")
_RENDER_SUMMARY = os.getenv("GHA_PIP_AUDIT_SUMMARY", "true") == "true"
_DEBUG = os.getenv("GHA_PIP_AUDIT_INTERNAL_BE_CAREFUL_DEBUG", "false") != "false"

Expand All @@ -27,7 +28,7 @@ def _template(name):

def _summary(msg):
if _RENDER_SUMMARY:
print(msg, file=_SUMMARY)
print(msg, file=_GITHUB_STEP_SUMMARY)


def _debug(msg):
Expand Down Expand Up @@ -138,9 +139,8 @@ def _fatal_help(msg):
output = io.read()

# This is really nasty: our output contains multiple lines,
# so we can't naively stuff it into an output (since this is all done
# in-channel as a special command on stdout).
print(f"::set-output name=output::{b64encode(output.encode()).decode()}")
# so we can't naively stuff it into an output.
print(f"output={b64encode(output.encode()).decode()}", file=_GITHUB_OUTPUT)

_log(output)
_summary(output)
Expand Down

0 comments on commit 5ed8d31

Please sign in to comment.