Skip to content

Commit

Permalink
supply type
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlancaster committed Nov 13, 2024
1 parent ea4a640 commit 7683a19
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/update_citations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
workflow_call: # This allows the workflow to be triggered by another workflow
inputs:
CITATION_DIR:
description: 'Directory for citations'
#description: 'Directory for citations'
required: true
default: 'src/PyPop/citation'
type: string
INIT_FILE:
description: 'Path to the init file'
#description: 'Path to the init file'
required: true
default: 'src/PyPop/__init__.py'
type: string

jobs:
do-citation-updates:
Expand All @@ -22,9 +24,10 @@ jobs:
import ast
with open("${{ inputs.INIT_FILE }}") as f:
contents = f.read()
citation_output_formats = next((node.value.elts for node in ast.walk(ast.parse(contents)) if isinstance(node, ast.Assign) and node.targets[0].id == 'citation_output_formats'), [])
formats = ','.join([str(elem.value) for elem in citation_output_formats])
print(f'::set-output name=formats::{formats}')
citation_output_formats = next((node.value.elts for node in ast.walk(ast.parse(contents)) if isinstance(node, ast.Assign) and node.targets[0].id == "citation_output_formats"), [])
formats = ",".join([str(elem.value) for elem in citation_output_formats])
with open("${{ steps.extract_formats.outputs.formats_file }}", "w") as f:
f.write(formats)
'
- name: Copy CITATION.cff to citation directory
Expand Down

0 comments on commit 7683a19

Please sign in to comment.