Skip to content

Commit

Permalink
Support arbitrary inputs to reusable workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
h-haaks committed Apr 23, 2024
1 parent 3e46f99 commit a9de596
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion moduleroot/.github/workflows/ci.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: '<%= @configs['pidfile_workaround'] %>'
<%- if @configs['with'] -%>
<%- @configs['with'].each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
<%- if @configs['unit_runs_on'] -%>
unit_runs_on: '<%= @configs['unit_runs_on'] %>'
<%- end -%>
Expand All @@ -37,9 +42,14 @@ jobs:
<%- end -%>
<%- else -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v2
<%- if @configs.key?('rubocop') || !@configs['additional_packages'].empty? || @configs.key?('unit_runs_on') -%>
<%- if @configs.key?('rubocop') || !@configs['additional_packages'].empty? || @configs.key?('unit_runs_on') || @configs.key?('with') -%>
with:
<%- end -%>
<%- if @configs['with'] -%>
<%- @configs['with'].each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
<%- end -%>
<%- unless @configs['additional_packages'].empty? -%>
additional_packages: '<%= @configs['additional_packages'] %>'
Expand Down
5 changes: 5 additions & 0 deletions moduleroot/.github/workflows/release.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2
with:
<%- if @configs['with'] -%>
<%- @configs['with'].each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
allowed_owner: '<%= @configs[:namespace] %>'
secrets:
# Configure secrets here:
Expand Down

0 comments on commit a9de596

Please sign in to comment.