Skip to content

Conversation

@mhashizume
Copy link
Contributor

Previously, in using the unit test workflows with Puppet modules, we set Puppet 7's PUPPET_FORGE_TOKEN environment variable to '' and in module Gemfiles evaluated !ENV['PUPPET_FORGE_TOKEN'].to_s.empty?.

However, the latest PDK template's (3.5.1) Gemfile evaluates the PUPPET_FORGE_TOKEN environment variable slightly differently, opting instead to check whether it exists at all:

https://github.com/puppetlabs/pdk-templates/blob/3.5.1.2/moduleroot/Gemfile.erb#L63

Ruby confusingly evaluates everything besides false and nil as "truthy," so an empty string (like the one we set for PUPPET_FORGE_TOKEN) is evaluated as true.

This commit updates Puppet 7's environment variable to be set to null instead of an empty string to allow the workflow to be used with PDK template 3.5.1

Previously, in using the unit test workflows with Puppet modules, we set
Puppet 7's PUPPET_FORGE_TOKEN environment variable to '' and in module
Gemfiles evaluated `!ENV['PUPPET_FORGE_TOKEN'].to_s.empty?`.

However, the latest PDK template's (3.5.1) Gemfile evaluates the
PUPPET_FORGE_TOKEN environment variable slightly differently, opting
instead to check whether it exists at all:

https://github.com/puppetlabs/pdk-templates/blob/3.5.1.2/moduleroot/Gemfile.erb#L63

Ruby confusingly evaluates everything besides false and nil as "truthy,"
so an empty string (like the one we set for PUPPET_FORGE_TOKEN) is
evaluated as true.

This commit updates Puppet 7's environment variable to be set to null
instead of an empty string to allow the workflow to be used with PDK
template 3.5.1
@joshcooper joshcooper merged commit dc9bd59 into puppetlabs:main Oct 31, 2025
2 checks passed
@mhashizume mhashizume deleted the maint/main/pdk-conditional branch October 31, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants