Skip to content

Conversation

@jenseng
Copy link
Owner

@jenseng jenseng commented Dec 20, 2025

Fixes #17

Optionally set env vars for each of the action's outputs. This provides a simpler method to access outputs than the default fromJSON approach.

For example, instead of:

- id: setup_node
  uses: jenseng/dynamic-uses@v1
  with:
    uses: actions/setup-node@${{ inputs.version }}
    with: |
      node-version: 18
- env:
    # pull the node-version out of the outputs
    node_version: ${{ fromJSON(steps.setup_node.outputs.outputs).node-version }}
  run: echo "Installed $node_version"

You can set env-outputs: true like so:

- uses: jenseng/dynamic-uses@v1
  with:
    uses: actions/setup-node@${{ inputs.version }}
    with: |
      node-version: 18
    env-outputs: true # this will set a node_version env var for the node-version output
- run: echo "Installed $node_version"
  # it can also be used in subsequent step expressions, e.g. `env.node_version`

For more control over the output variable names and how to deal with potential conflicts, see the new env-outputs-prefix, env-outputs-upcase, and env-outputs-on-conflict options documented in the README, metadata file, and tests.

@jenseng jenseng force-pushed the env-outputs branch 9 times, most recently from 65596e9 to 8d87457 Compare December 20, 2025 01:12
@jenseng jenseng force-pushed the env-outputs branch 8 times, most recently from 4180ea6 to 21eec31 Compare December 20, 2025 06:56
@jenseng jenseng changed the title env outputs feat: set env vars for outputs Jan 6, 2026
@jenseng jenseng marked this pull request as ready for review January 6, 2026 01:58
@jenseng jenseng force-pushed the env-outputs branch 2 times, most recently from 3781705 to 3c067d9 Compare January 6, 2026 18:03
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.

Optionally unwrap an output

2 participants