[GH-ISSUE #294] variables set using "::set-env" are not available to the steps commands #205

Closed
opened 2026-03-01 21:41:13 +03:00 by kerem · 2 comments
Owner

Originally created by @cuotos on GitHub (Jun 25, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/294

I am using docker/build-push-action and wanted to set an env var in a Step and use it in the value of an input argument to another step.

      - name: extract branch name
        run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF##*/})"

      - uses: docker/build-push-action@v1
        with:
          ...
          build_args: version=${{ env.BRANCH_NAME }}

If BRANCH_NAME is set using "env: " in the actions file it is usable, but if i set it using actions "::set-env" syntax then the var is available IN THE CONTAINER, but not to the commands in the actions file.

I spent a long time trying to work out how to do this in actions, pushed a test file and found that on github this works, but using act it doesn't.

Originally created by @cuotos on GitHub (Jun 25, 2020). Original GitHub issue: https://github.com/nektos/act/issues/294 I am using docker/build-push-action and wanted to set an env var in a Step and use it in the value of an input argument to another step. ``` - name: extract branch name run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF##*/})" - uses: docker/build-push-action@v1 with: ... build_args: version=${{ env.BRANCH_NAME }} ``` If BRANCH_NAME is set using "env: " in the actions file it is usable, but if i set it using actions "::set-env" syntax then the var is available IN THE CONTAINER, but not to the commands in the actions file. I spent a long time trying to work out how to do this in actions, pushed a test file and found that on github this works, but using act it doesn't.
kerem 2026-03-01 21:41:13 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@guzart commented on GitHub (Jul 2, 2020):

I was able to get around this by adding an extra step in between that simply echo's the env var. That somehow makes it available for the next step as an input.

<!-- gh-comment-id:653262871 --> @guzart commented on GitHub (Jul 2, 2020): I was able to get around this by adding an extra step in between that simply echo's the env var. That somehow makes it available for the next step as an input.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 1, 2020):

Issue is stale and will be closed in 7 days unless there is new activity

<!-- gh-comment-id:684117425 --> @github-actions[bot] commented on GitHub (Sep 1, 2020): Issue is stale and will be closed in 7 days unless there is new activity
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#205
No description provided.