小编Aja*_*y k的帖子

自定义 GitHub Actions 中的新输出格式,因为 set-output 将被弃用

根据 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 文件中使用新格式的任何解决方案。

github github-actions

3
推荐指数
1
解决办法
1497
查看次数

标签 统计

github ×1

github-actions ×1