Skip to content

Commit

Permalink
CI: Print summary for outdated modules
Browse files Browse the repository at this point in the history
Previously we only printed a diff for every module. Now we also print a
hacky table with every outdated module.
  • Loading branch information
bastelfreak committed Jan 14, 2024
1 parent eb57742 commit b74bbc3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
unit:
runs-on: ubuntu-latest
name: Run msync --noop against all modules
name: Run msync --noop against all modules and print a summary
steps:
- uses: actions/checkout@v4
- name: Setup ruby
Expand All @@ -20,6 +20,8 @@ jobs:
bundler-cache: true
- name: Run msync --noop
run: bundle exec msync update --noop --git-base=https://github.com/ --branch foobranch
- name: Generate summary
run: bundle exec bin/outdated_modules_and_their_version
metadata_json_deps:
runs-on: ubuntu-latest
name: Run metadata_json_deps on all modules
Expand Down
17 changes: 17 additions & 0 deletions bin/outdated_modules_and_their_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env ruby

require 'yaml'
require 'erb'

# the current version in modulesync_config
version = YAML.load(ERB.new(File.read('moduleroot/.msync.yml.erb')).result)['modulesync_config_version']

puts "current version: #{version}"
puts '---------------------------------------------'
puts "| Module\t| modulesync_config version |"
puts '---------------------------------------------'
Dir.glob('modules/voxpupuli/puppet-*/.msync.yml').each do|f|
version_module = YAML.load_file(f)['modulesync_config_version']
mod = f.split('/')[2]
puts "| #{mod}\t| #{version_module}\t|" if version != version_module
end

0 comments on commit b74bbc3

Please sign in to comment.