-
Notifications
You must be signed in to change notification settings - Fork 71
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
Cleanup workflow templates; require 'with' key in module's .sync.yml #893
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it can be reduced even further. Sending a diff is tricky, so here's the code: jobs:
puppet:
name: Puppet
<%- if @configs['acceptance_tests'] && Dir[File.join(@metadata[:workdir], 'spec', 'acceptance', '**', '*_spec.rb')].any? -%>
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
<%- else -%>
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v2
<%- end -%>
<%- if @configs['with'] -%>
with:
<%- @configs['with'].each do |k,v| -%>
<%- if v.is_a?(String) -%>
<%= k %>: '<%= v %>'
<%- else -%>
<%= k %>: <%= v %>
<%- end -%>
<%- end -%>
<%- end -%> You can even use <%- @configs['with'].each do |k,v| -%>
<%= k %>: <%= v.inspect %>
<%- end -%> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. inspect returns a double quoted string. That will generate lots of diffs/changes in the next msync run i guess.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yes, I may have confused it with Python where |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,10 +16,16 @@ jobs: | |||||
with: | ||||||
<%- if @configs['with'] -%> | ||||||
<%- @configs['with'].each do |k,v| -%> | ||||||
<%= k %>: <%= v %> | ||||||
<%- if v.is_a?(String) -%> | ||||||
<%= k %>: '<%= v %>' | ||||||
<%- else -%> | ||||||
<%= k %>: <%= v %> | ||||||
<%- end -%> | ||||||
<%- end -%> | ||||||
<%- end -%> | ||||||
<%- if @configs['with'].nil? || !@configs['with'].has_key?('allowed_owner') -%> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is indeed intended to prevent running on forks. Isn't this equivalent?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, advanced ruby ... |
||||||
allowed_owner: '<%= @configs[:namespace] %>' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Figure this is whats blocking forks from releasing. |
||||||
<%- end -%> | ||||||
secrets: | ||||||
# Configure secrets here: | ||||||
# https://docs.github.com/en/actions/security-guides/encrypted-secrets | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured these to be unnecessary as it's the default value defined in the reusable workflows.
The next msync run will remove these inputs from ci.yml.