Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action: remove deprecated use of set-output #29

Merged
merged 1 commit into from Nov 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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