Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reusable workflows #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions actions_includes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,11 @@ def expand_step_run(current_filepath, v):


def expand_job_steps(current_filepath, job_data):
assert 'steps' in job_data, pprint.pformat(job_data)
if 'steps' not in job_data:
# make sure this job is using reusable workflows,
# which don't have steps
assert 'uses' in job_data, pprint.pformat(job_data)
return job_data

steps = list((current_filepath, s) for s in job_data['steps'])

Expand Down Expand Up @@ -963,7 +967,11 @@ def expand_workflow(current_workflow, to_path, insert_check_steps: bool):
})

for j in data['jobs'].values():
assert 'steps' in j, pprint.pformat(j)
if 'steps' not in j:
# make sure this job is using reusable workflows,
# which don't have steps
assert 'uses' in j, pprint.pformat(j)
continue
steps = j['steps']
assert isinstance(steps, list), pprint.pformat(j)

Expand Down