Skip to content

Commit

Permalink
chore: use output file instead of environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
r4mmer committed Jul 4, 2023
1 parent 63697f1 commit c911637
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ jobs:
matrix = full_matrix
else:
matrix = reduced_matrix
outputs = []
if os.environ['GITHUB_OUTPUT']:
outputs.append(os.environ['GITHUB_OUTPUT'])
outputs.append('{name}={value}'.format(name='matrix', value=json.dumps(matrix)))
os.environ['GITHUB_OUTPUT'] = '\n'.join(outputs)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('matrix={}\n'.format(json.dumps(matrix)))
check-matrix:
runs-on: ubuntu-latest
needs: matrix
Expand Down
9 changes: 3 additions & 6 deletions extras/github/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
from typing import Dict

def print_output(output: Dict):
outputs = []
if os.environ['GITHUB_OUTPUT']:
outputs.append(os.environ['GITHUB_OUTPUT'])
for k, v in output.items():
outputs.append('{name}={value}'.format(name=k, value=v))
os.environ['GITHUB_OUTPUT'] += '\n'.join(outputs)
outputs = ['{}={}\n'.format(k, v) for k, v in output.items()]
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.writelines(outputs)

def prep_base_version(environ: Dict):
GITHUB_REF = environ.get('GITHUB_REF')
Expand Down

0 comments on commit c911637

Please sign in to comment.