From 004d2e03712b58cbd8f8610670a481e0b2615638 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 14 Jan 2024 21:31:27 +0100 Subject: [PATCH] CI: Print summary for outdated modules Previously we only printed a diff for every module. Now we also print a hacky table with every outdated module. --- .github/workflows/main.yml | 4 +++- bin/outdated_modules_and_their_version | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 bin/outdated_modules_and_their_version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd0b6de7..af0cac01 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -20,6 +20,8 @@ jobs: bundler-cache: true - name: Run msync --noop run: bundle exec msync update --noop --git-base=https://github.com/ + - 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 diff --git a/bin/outdated_modules_and_their_version b/bin/outdated_modules_and_their_version new file mode 100755 index 00000000..41a529c0 --- /dev/null +++ b/bin/outdated_modules_and_their_version @@ -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