As announced in
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
the `::set-output` command is deprecated, because processes during the workflow
execution might output untrusted information that might include the
`::set-output` command, thus allowing these untrusted information to hijack the
build.
The replacement is writing to the file indicated by the `$GITHUB_OUTPUT`
environment variable.
import sys
import urllib.request
import re
+from os import environ
if len(sys.argv) == 2:
build_type = sys.argv[1]
print(json.dumps(matrix, indent=4, sort_keys=True))
-print("::set-output name=matrix::{}".format(json.dumps({"include": matrix})))
+if environ.get('GITHUB_OUTPUT') is not None:
+ with open(environ.get('GITHUB_OUTPUT'), 'a') as f:
+ print("matrix={}".format(json.dumps({"include": matrix})), file=f)