diff --git a/.github/workflows/static_code_analysis.yaml b/.github/workflows/static_code_analysis.yaml index 62438da..351c74a 100644 --- a/.github/workflows/static_code_analysis.yaml +++ b/.github/workflows/static_code_analysis.yaml @@ -11,3 +11,4 @@ on: jobs: static_code_analysis: uses: "puppetlabs/phoenix-github-actions/.github/workflows/static_code_analysis.yaml@main" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 81a0f34..52df062 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -11,6 +11,8 @@ on: jobs: Nightly: uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main" + secrets: inherit Released: uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main" + secrets: inherit diff --git a/.sync.yml b/.sync.yml index d2598a6..f88e0a5 100644 --- a/.sync.yml +++ b/.sync.yml @@ -10,6 +10,7 @@ Gemfile: version: '~> 1.0' - gem: beaker-hostgenerator from_env: BEAKER_HOSTGENERATOR_VERSION + version: '~> 2' - gem: beaker-rspec from_env: BEAKER_RSPEC_VERSION # Prevent beaker-puppet from being installed on Ruby > 3.1 until diff --git a/Gemfile b/Gemfile index 9479621..e009fcc 100644 --- a/Gemfile +++ b/Gemfile @@ -53,18 +53,22 @@ group :system_tests do gem "voxpupuli-acceptance", require: false end -puppet_version = ENV['PUPPET_GEM_VERSION'] -facter_version = ENV['FACTER_GEM_VERSION'] -hiera_version = ENV['HIERA_GEM_VERSION'] +puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil) +facter_version = ENV.fetch('FACTER_GEM_VERSION', nil) +hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) gems = {} -gems['puppet'] = location_for(puppet_version) - -# If facter or hiera versions have been specified via the environment -# variables +# If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet +# Otherwise, do as before and use location_for to fetch gems from the default source +if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gems['puppet'] = ['~> 8.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] + gems['facter'] = ['~> 4.11', { require: false, source: 'https://rubygems-puppetcore.puppet.com' }] +else + gems['puppet'] = location_for(puppet_version) + gems['facter'] = location_for(facter_version) if facter_version +end -gems['facter'] = location_for(facter_version) if facter_version gems['hiera'] = location_for(hiera_version) if hiera_version gems.each do |gem_name, gem_params|