[GH-ISSUE #1459] GITHUB_STATE and save-state command ignored in pre step #751

Closed
opened 2026-03-01 21:46:05 +03:00 by kerem · 0 comments
Owner

Originally created by @ChristopherHX on GitHub (Nov 23, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1459

Bug report info

N/A

Command used with act

./act -P self-hosted=-self-hosted -W /home/christopher/github-actions/host_environment/pkg/runner/testdata/failing-pre-step-logging/push.yml | grep STATE_

Describe issue

The state is of a pre steps is lost in the void. Using it in the main stage works as expected.
Only mystate2 and mystate3 are set as env varables, mystate and mystate0 are lost.

No response

Workflow content

on: push
jobs:
  _:
    runs-on: self-hosted
    steps:
    - uses: christopherhx/script@main
      with:
        pre: |
          env
          echo mystate=mystateval > $GITHUB_STATE
          echo "::save-state name=mystate0::mystateval"
        main: |
          env
          echo mystate2=mystateval > $GITHUB_STATE
          echo "::save-state name=mystate3::mystateval"
        post: |
          env

Relevant log output

[push.yml/_]   | STATE_mystate2=mystateval
[push.yml/_]   | STATE_mystate3=mystateval

Additional information

No response

Originally created by @ChristopherHX on GitHub (Nov 23, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1459 ### Bug report info ```plain text N/A ``` ### Command used with act ```sh ./act -P self-hosted=-self-hosted -W /home/christopher/github-actions/host_environment/pkg/runner/testdata/failing-pre-step-logging/push.yml | grep STATE_ ``` ### Describe issue The state is of a pre steps is lost in the void. Using it in the main stage works as expected. Only mystate2 and mystate3 are set as env varables, mystate and mystate0 are lost. ### Link to GitHub repository _No response_ ### Workflow content ```yml on: push jobs: _: runs-on: self-hosted steps: - uses: christopherhx/script@main with: pre: | env echo mystate=mystateval > $GITHUB_STATE echo "::save-state name=mystate0::mystateval" main: | env echo mystate2=mystateval > $GITHUB_STATE echo "::save-state name=mystate3::mystateval" post: | env ``` ### Relevant log output ```sh [push.yml/_] | STATE_mystate2=mystateval [push.yml/_] | STATE_mystate3=mystateval ``` ### Additional information _No response_
kerem 2026-03-01 21:46:05 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#751
No description provided.