timescaledb/.github/gh_config_reader.py
Mats Kindahl 84b2fef6ef Fix GitHub output action
To avoid untrusted logged data to use `set-state` and `set-output`
workflow commands without the intention of the workflow author GitHub
have introduced a new set of environment files to manage state and
output.

This commit changes the existing uses of `set-output` to use the new
environment files instead.

See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2022-10-21 11:10:09 +02:00

17 lines
544 B
Python

#!/usr/bin/env python
# This file and its contents are licensed under the Apache License 2.0.
# Please see the included NOTICE for copyright information and
# LICENSE-APACHE for a copy of the license.
import ci_settings
import json
import os
# generate commands to set github action variables
for key in dir(ci_settings):
if not key.startswith("__"):
value = getattr(ci_settings, key)
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
print(str.format("{0}={1}", key, json.dumps(value)), file=output)