File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 11
11
jobs :
12
12
Nightly :
13
13
uses : " puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
14
+ secrets : inherit
14
15
15
16
Released :
16
17
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']
58
58
hiera_version = ENV [ 'HIERA_GEM_VERSION' ]
59
59
60
60
gems = { }
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 )
61
64
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
66
74
67
- gems [ 'facter' ] = location_for ( facter_version ) if facter_version
68
75
gems [ 'hiera' ] = location_for ( hiera_version ) if hiera_version
69
76
70
77
gems . each do |gem_name , gem_params |
You can’t perform that action at this time.
0 commit comments