[GH-ISSUE #407] Environment injected in script instead of in shell #288

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

Originally created by @Bigpet on GitHub (Nov 3, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/407

I've run into an incompatibility with the GitHub Actions runner. When setting a custom shell command act seems to assume a normal shell whereas the GitHub Actions runner can deal with things like python just fine.

name: Test act
on:
  release:
jobs:
  test_shell_run:
    name: Test shell run
    runs-on: ubuntu-latest
    steps:
      - name: Test script prepend
        id: full_output
        shell: cat {0}
        run: |
          some other non bash scripting lang
          is written here

This creates a shell script full_output, but doesn't just dump the "run:" commands in it, but also inserts some shell environment variable commands into the file (namely "PATH=":${PATH}"")

It would be great if the environment stuff would be setup into the environment that "shell" is executed in, instead of trying to set it up from inside.

expected output

[Test act/Test shell run]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test act/Test shell run] ⭐  Run Test script prepend
| some other non bash scripting lang
| is written here
[Test act/Test shell run]   ✅  Success - Test script prepend

actual output

[Test act/Test shell run]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test act/Test shell run] ⭐  Run Test script prepend
| PATH=":${PATH}"
| some other non bash scripting lang
| is written here
[Test act/Test shell run]   ✅  Success - Test script prepend

version

act version 0.2.16
MacOs

Originally created by @Bigpet on GitHub (Nov 3, 2020). Original GitHub issue: https://github.com/nektos/act/issues/407 I've run into an incompatibility with the GitHub Actions runner. When setting a custom shell command act seems to assume a normal shell whereas the GitHub Actions runner can deal with things like `python` just fine. ``` name: Test act on: release: jobs: test_shell_run: name: Test shell run runs-on: ubuntu-latest steps: - name: Test script prepend id: full_output shell: cat {0} run: | some other non bash scripting lang is written here ``` This creates a shell script `full_output`, but doesn't just dump the "run:" commands in it, but also inserts some shell environment variable commands into the file (namely "PATH=":${PATH}"") It would be great if the environment stuff would be setup into the environment that "shell" is executed in, instead of trying to set it up from inside. ### expected output ``` [Test act/Test shell run] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Test act/Test shell run] ⭐ Run Test script prepend | some other non bash scripting lang | is written here [Test act/Test shell run] ✅ Success - Test script prepend ``` ### actual output ``` [Test act/Test shell run] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Test act/Test shell run] ⭐ Run Test script prepend | PATH=":${PATH}" | some other non bash scripting lang | is written here [Test act/Test shell run] ✅ Success - Test script prepend ``` ### version act version 0.2.16 MacOs
kerem closed this issue 2026-03-01 21:42:05 +03:00
Author
Owner

@winksaville commented on GitHub (Nov 3, 2020):

This should be fixed by change #406. If you checkout the master branch and execute make build and then execute dist/local/act it should work. It worked for me:

$ ~/prgs/nektos/forks/act/dist/local/act 
[Test act/Test shell run] 🚀  Start image=ubuntu-with-hello
[Test act/Test shell run]   🐳  docker run image=ubuntu-with-hello entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Test act/Test shell run] ⭐  Run Test script prepend
| some other non bash scripting lang
| is written here
[Test act/Test shell run]   ✅  Success - Test script prepend
<!-- gh-comment-id:721254104 --> @winksaville commented on GitHub (Nov 3, 2020): This should be fixed by change #406. If you checkout the master branch and execute `make build` and then execute `dist/local/act` it should work. It worked for me: ``` $ ~/prgs/nektos/forks/act/dist/local/act [Test act/Test shell run] 🚀 Start image=ubuntu-with-hello [Test act/Test shell run] 🐳 docker run image=ubuntu-with-hello entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Test act/Test shell run] ⭐ Run Test script prepend | some other non bash scripting lang | is written here [Test act/Test shell run] ✅ Success - Test script prepend ```
Author
Owner

@Bigpet commented on GitHub (Nov 4, 2020):

Yep, that fixed my issue.

Thanks for the quick fix.

<!-- gh-comment-id:721797422 --> @Bigpet commented on GitHub (Nov 4, 2020): Yep, that fixed my issue. Thanks for the quick fix.
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#288
No description provided.