Skip to content

Commit

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

def print_output(output: Dict):
str_output = '\n'.join(['{}={}'.format(k, v) for k, v in output.items()])
os.environ['GITHUB_OUTPUT'] += str_output + '\n'
outputs = []
if os.environ['GITHUB_OUTPUT']:
outputs.push(os.environ['GITHUB_OUTPUT'])
for k, v in output.items():
outputs.push('{name}={value}'.format(name=k, value=v))
os.environ['GITHUB_OUTPUT'] += '\n'.join(outputs)

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

0 comments on commit d958e31

Please sign in to comment.