File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1111jobs :
1212 static_code_analysis :
1313 uses : " puppetlabs/phoenix-github-actions/.github/workflows/static_code_analysis.yaml@main"
14+ secrets : inherit
Original file line number Diff line number Diff line change 1111jobs :
1212 Nightly :
1313 uses : " puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
14+ secrets : inherit
1415
1516 Released :
1617 uses : " puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main"
18+ secrets : inherit
Original file line number Diff line number Diff line change @@ -58,13 +58,20 @@ facter_version = ENV['FACTER_GEM_VERSION']
5858hiera_version = ENV [ 'HIERA_GEM_VERSION' ]
5959
6060gems = { }
61+ puppet_version = ENV . fetch ( 'PUPPET_GEM_VERSION' , nil )
62+ facter_version = ENV . fetch ( 'FACTER_GEM_VERSION' , nil )
63+ hiera_version = ENV . fetch ( 'HIERA_GEM_VERSION' , nil )
6164
62- gems [ 'puppet' ] = location_for ( puppet_version )
63-
64- # If facter or hiera versions have been specified via the environment
65- # variables
65+ # If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet
66+ # Otherwise, do as before and use location_for to fetch gems from the default source
67+ if !ENV [ 'PUPPET_FORGE_TOKEN' ] . to_s . empty?
68+ gems [ 'puppet' ] = [ '~> 8.11' , { require : false , source : 'https://rubygems-puppetcore.puppet.com' } ]
69+ gems [ 'facter' ] = [ '~> 4.11' , { require : false , source : 'https://rubygems-puppetcore.puppet.com' } ]
70+ else
71+ gems [ 'puppet' ] = location_for ( puppet_version )
72+ gems [ 'facter' ] = location_for ( facter_version ) if facter_version
73+ end
6674
67- gems [ 'facter' ] = location_for ( facter_version ) if facter_version
6875gems [ 'hiera' ] = location_for ( hiera_version ) if hiera_version
6976
7077gems . each do |gem_name , gem_params |
You can’t perform that action at this time.
0 commit comments