Skip to content

Commit

Permalink
The irongut/CodeCoverageSummary action does not like absolute paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Nov 9, 2022
1 parent 68c8263 commit 1c9d960
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,20 @@ runs:
with OUTPUTS_FILE_PATH.open(FILE_APPEND_MODE) as outputs_file:
outputs_file.writelines(f'{name}={value}{os.linesep}')
directory = "${{
format(
'{0}/{1}',
(
inputs.collection-src-directory
&& inputs.collection-src-directory
|| '.tmp-ansible-collection-checkout'
),
inputs.collection-root
)
}}"
COLLECTION_META_FILE = 'galaxy.yml'
with open(COLLECTION_META_FILE) as galaxy_yml:
with open(os.path.join(directory, COLLECTION_META_FILE)) as galaxy_yml:
collection_meta = yaml.load(galaxy_yml)
coll_name = collection_meta['name']
Expand All @@ -314,14 +326,13 @@ runs:
set_output('fqcn', f'{coll_ns}.{coll_name}')
cwd = os.getcwd()
wanted_path = f'ansible_collections{os.sep}{coll_ns}{os.sep}{coll_name}'
if cwd.endswith(wanted_path):
if directory.endswith(wanted_path):
set_output('copy-to-checkout-path', 'false')
set_output(
'collection-namespace-path',
os.path.normpath(os.path.join(cwd, '..')))
set_output('checkout-path', cwd)
os.path.normpath(os.path.join(directory, '..')))
set_output('checkout-path', directory)
else:
set_output('copy-to-checkout-path', 'true')
set_output(
Expand All @@ -331,18 +342,6 @@ runs:
'checkout-path',
os.path.join('ansible_collections', coll_ns, coll_name))
shell: python
working-directory: >-
${{
format(
'{0}/{1}',
(
inputs.collection-src-directory
&& inputs.collection-src-directory
|| '.tmp-ansible-collection-checkout'
),
inputs.collection-root
)
}}

- name: Log the next step action
if: >-
Expand Down

0 comments on commit 1c9d960

Please sign in to comment.