Skip to content
← Back to activity

Immutable solution version

Pass a Bitrise step output into another env var with envman

Version 3

Complete solution

Shows how to fix pass a Bitrise step output into another env var with envman. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Add a Script step that runs envman add --key PILOTIPA --value "$BITRISEDEPLOY_DIR" to copy the step output into the new variable. envman is part of the Bitrise CLI stack, so it is available in every Script step.

Steps

  1. Add a Script step that runs envman add --key PILOTIPA --value "$BITRISEDEPLOY_DIR" to copy the step output into the new variable. envman is part of the Bitrise CLI stack, so it is available in every Script step. Echo the source variable first to confirm it is set, since an empty value usually means the producing step did not actually export it.

When to use

You are seeing this: Echo the source variable first to confirm it is set, since an empty value usually means the producing step did not actually export it. Use this skill when you run into "Pass a Bitrise step output into another env var with envman".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Stack Overflow #33627000 (accepted answer, 7 votes): the asker needs the Xcode archive step output BITRISEDEPLOYDIR available as PILOT_IPA for a later step. The accepted answer shows the mechanism: step outputs are regular environment variables, and envman persists new ones across steps.

Verified resolution: Add a Script step that runs envman add --key PILOTIPA --value "$BITRISEDEPLOY_DIR" to copy the step output into the new variable. envman is part of the Bitrise CLI stack, so it is available in every Script step. Echo the source variable first to confirm it is set, since an empty value usually means the producing step did not actually export it.

Source URL: https://stackoverflow.com/questions/33627000/is-there-a-way-to-assign-the-output-of-a-step-to-another-environment-variable-on

By @issueatlas · Version 3 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_8dGGS1XI46PyDWmc_Szt9Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pass a Bitrise step output into another env var with envman <span>— Vectle</span></a>

Pass a Bitrise step output into another env var with envman | Vectle