Skip to content

Commit

Permalink
Get rid of set-output.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored and webknjaz committed Oct 19, 2022
1 parent 4160a88 commit c5dcdac
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ runs:
id: compute-origin-python-version
run: |
# Compute job Python version
import os
import sys
def set_output(name, value):
with open(os.getenv('GITHUB_OUTPUT'), 'a') as out:
print(f'{name}={value}', file=out)
# Input from GHA
origin_python_version = '${{ inputs.origin-python-version }}'
old_python_version = '${{ inputs.python-version }}'
Expand Down Expand Up @@ -145,7 +150,7 @@ runs:
)
# Set computed origin-python-version
print(f'::set-output name=origin-python-version::{origin_python_version}')
set_output('origin-python-version', origin_python_version)
shell: python
- name: Log the next step action
run: >-
Expand Down Expand Up @@ -204,31 +209,26 @@ runs:
- name: Extract the collection metadata
id: collection-metadata
run: |
import os
import yaml
def set_output(name, value):
with open(os.getenv('GITHUB_OUTPUT'), 'a') as out:
print(f'{name}={value}', file=out)
COLLECTION_META_FILE = 'galaxy.yml'
with open(COLLECTION_META_FILE) as galaxy_yml:
collection_meta = yaml.load(galaxy_yml)
coll_name = collection_meta['name']
coll_ns = collection_meta['namespace']
print('::set-output name=name::{name}'.format(name=coll_name))
print('::set-output name=namespace::{ns}'.format(ns=coll_ns))
set_output('name', coll_name)
set_output('namespace', coll_ns)
print(
'::set-output name=fqcn::{ns}.{name}'.
format(name=coll_name, ns=coll_ns)
)
print(
'::set-output '
'name=collection-namespace-path::ansible_collections/{ns}'.
format(ns=coll_ns)
)
print(
'::set-output name=checkout-path::ansible_collections/{ns}/{name}'.
format(name=coll_name, ns=coll_ns)
)
set_output('fqcn', f'{coll_ns}.{coll_name}')
set_output('collection-namespace-path', f'ansible_collections/{coll_ns}')
set_output('checkout-path', f'ansible_collections/{coll_ns}/{coll_name}')
shell: python
working-directory: >-
${{
Expand Down Expand Up @@ -460,7 +460,7 @@ runs:
}}/tests/output/reports/coverage=${{
inputs.testing-type
}}=*.xml"
&& echo "::set-output name=present::true"
&& ( echo "present=true" >> ${GITHUB_OUTPUT} )
;
exit 0
shell: bash
Expand Down

0 comments on commit c5dcdac

Please sign in to comment.