actions / actions/toolkit

Add `steps` variable?

Open
#863 1 comment 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the enhancement

It'd be nice to be able to get previous step outputs as part of the script.

Code Snippet

- uses: actions/github-script@v4
  with:
    script: |-
      console.log('previous step value: ' + steps.some_previous_step.foo)

Alternatively could it be attached to context? so

console.log('previous step value: ' + context.steps.some_previous_step.foo)

Additional information

Right now I think this has to be passed through via env vars or similar

- uses: actions/github-script@v4
  with:
    script: |-
      console.log('previous step value: ' + process.env.FOO)
  env:
    FOO: ${{ steps.some_previous_step.foo }}

Which is ok, but it makes the script less portable and readable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the actions/github-script@v4 handling of the script, context, and environment variables, then compare it with the proposed steps.some_previous_step and context.steps access. Done means previous step outputs can be accessed from the script without requiring the env workaround, with the supported access pattern documented or tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript, typescript
Domain
devops, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.