How the value of a secret on fastfile?

How do I get the value of a secret and put it inside the variable in the fastfile?

Example pipeline:

version: v1.0
name: Test
agent:
  machine:
    type: a1-standard-4
blocks:
  - name: Test
    task:
      secrets:
        - name: secret-test
      prologue:
        commands:
          - checkout
      jobs:
        - name: Deploy
          commands:
            - bundle exec fastlane valueSecretTest

Example lane:

              desc "Get the value of the secret"
              lane :valueSecretTest do
                name = secretValue
              end

If the secret name is an environment variable, it will be imported into the CI machine and you should be able to access it from your code.

Supposing that the secrets contains a variables called HELLO. You may use something like this to get its value.

puts ENV[‘HELLO’]

1 Like

So, it would be:

              desc "Get the value of the secret"
              lane :valueSecretTest do
                name = ENV[HELLO]
              end