根据 GitHub 最近的公告,github 操作set-output
将于明年被弃用。我能够echo "{name}={value}" >> $GITHUB_OUTPUT
在工作流程文件中使用新格式 ( ),并且它有效。但我们还有一个用 python 编写的自定义 GitHub 操作(私有操作),我们也将set-output
其用作main.py
:
output_matrix = json.dumps(jsondata)
print(f"::set-output name=output_matrix::{output_matrix}")
Run Code Online (Sandbox Code Playgroud)
到目前为止我尝试过的是:
print(f"output_matrix = {output_matrix} >> $GITHUB_OUTPUT")
但这似乎没有帮助。我们如何set-output
在自定义 github 操作 python 文件中使用新格式的任何解决方案。