You've already forked wakapi-readme-stats
proper GH variable setting
This commit is contained in:
@@ -48,5 +48,8 @@ class EnvironmentManager:
|
|||||||
DEBUG_RUN = getenv("DEBUG_RUN", "False").lower() in _TRUTHY
|
DEBUG_RUN = getenv("DEBUG_RUN", "False").lower() in _TRUTHY
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def set_variable(name: str, content: str):
|
def set_github_output(name: str, content: str):
|
||||||
environ[name] = content
|
if "GITHUB_OUTPUT" not in environ.keys():
|
||||||
|
raise Exception("Not in GitHub environment ('GITHUB_OUTPUT' not defined)!")
|
||||||
|
with open(environ["GITHUB_OUTPUT"], "a") as fh:
|
||||||
|
fh.write(f"{name}={content}")
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class GitHubManager:
|
|||||||
"""
|
"""
|
||||||
prefix = "README stats current output:"
|
prefix = "README stats current output:"
|
||||||
DBM.i("Commenting PR...")
|
DBM.i("Commenting PR...")
|
||||||
EM.set_variable("GITHUB_OUTPUT", f"README_CONTENT={prefix}\n\n{stats}")
|
EM.set_github_output("README_CONTENT", f"{prefix}\n\n{stats}")
|
||||||
DBM.g("PR commented!")
|
DBM.g("PR commented!")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user