[GH-ISSUE #1528] PATH is overwritten #774

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

Originally created by @KnisterPeter on GitHub (Dec 20, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1528

Bug report info

act version:            0.2.34-18-g4989f44
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/markusw/.actrc:
		-P ubuntu-latest=node:12-buster-slim
		-P ubuntu-20.04=node:12-buster-slim
		-P ubuntu-18.04=node:12-buster-slim
		-P ubuntu-16.04=node:12-stretch-slim
Build info:
	Go version:            go1.19.4
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -X main.version=0.2.34-18-g4989f44
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
Docker Engine:
	Engine version:        20.10.21+dfsg1
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Debian GNU/Linux bookworm/sid
	OS type:               linux
	OS version:            
	OS arch:               x86_64
	OS kernel:             6.0.0-5-amd64
	OS CPU:                12
	OS memory:             31734 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act

Describe issue

The PATH variable is overwritten (or reset) when an action is executed wich creates some output.
The workflow below prints the PATH in two places:

  1. after actions/setup-node and the node bins are in the PATH
  2. after the fea/changelog-action. In that place the PATH was reset.

The changelog actions is private, but in essence it just defines an output string. It does not install tools or modifies the PATH.

No response

Workflow content

name: test
on: push
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: debug 0
        run: |
          echo PATH=$PATH
      - id: changelog
        uses: fea/changelog-action@v1
      - name: debug 1
        run: |
          echo PATH=$PATH

Relevant log output

[test/test] ⭐ Run Pre fea/changelog-action@v1
[test/test]   ✅  Success - Pre fea/changelog-action@v1
[test/test] ⭐ Run Main actions/setup-node@v3
[test/test]   🐳  docker cp src=/home/markusw/.cache/act/actions-setup-node@v3/ dst=/var/run/act/actions/actions-setup-node@v3/
[test/test]   🐳  docker exec cmd=[node /var/run/act/actions/actions-setup-node@v3/dist/setup/index.js] user= workdir=
[test/test]   💬  ::debug::isExplicit: 
[test/test]   💬  ::debug::explicit? false
[test/test]   💬  ::debug::evaluating 0 versions
[test/test]   💬  ::debug::match not found
| Attempting to download 18...
[test/test]   💬  ::debug::No manifest cached
[test/test]   💬  ::debug::Getting manifest from actions/node-versions@main
[test/test]   💬  ::debug::check 18.12.1 satisfies 18
[test/test]   💬  ::debug::x64===x64 && darwin===linux
[test/test]   💬  ::debug::x64===x64 && linux===linux
[test/test]   💬  ::debug::matched 18.12.1
| Acquiring 18.12.1 - x64 from https://github.com/actions/node-versions/releases/download/18.12.1-3486235546/node-18.12.1-linux-x64.tar.gz
[test/test]   💬  ::debug::Downloading https://github.com/actions/node-versions/releases/download/18.12.1-3486235546/node-18.12.1-linux-x64.tar.gz
[test/test]   💬  ::debug::Destination /tmp/13b3dc68-7093-4428-bcee-91a6101f7fc9
[test/test]   💬  ::debug::download complete
| Extracting ...
[test/test]   💬  ::debug::Checking tar --version
[test/test]   💬  ::debug::tar (GNU tar) 1.30%0ACopyright (C) 2017 Free Software Foundation, Inc.%0ALicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.%0AThis is free software: you are free to change and redistribute it.%0AThere is NO WARRANTY, to the extent permitted by law.%0A%0AWritten by John Gilmore and Jay Fenlason.
| [command]/usr/bin/tar xz --strip 1 --warning=no-unknown-keyword -C /tmp/581a5375-8560-427c-a875-2cb808147a53 -f /tmp/13b3dc68-7093-4428-bcee-91a6101f7fc9
| Adding to the cache ...
[test/test]   💬  ::debug::Caching tool node 18.12.1 x64
[test/test]   💬  ::debug::source dir: /tmp/581a5375-8560-427c-a875-2cb808147a53
[test/test]   💬  ::debug::destination /opt/hostedtoolcache/node/18.12.1/x64
[test/test]   💬  ::debug::finished caching tool
| Done
[test/test]   ❓  ::group::Environment details
| node: v18.12.1
| 
| yarn: 1.22.19
| 
| npm: 8.19.2
| 
[test/test]   ❓  ::endgroup::
[test/test]##[add-matcher]/run/act/actions/actions-setup-node@v3/.github/tsc.json
[test/test]##[add-matcher]/run/act/actions/actions-setup-node@v3/.github/eslint-stylish.json
[test/test]##[add-matcher]/run/act/actions/actions-setup-node@v3/.github/eslint-compact.json
[test/test]   ✅  Success - Main actions/setup-node@v3
[test/test]   ⚙  ::set-output:: node-version=v18.12.1
[test/test]   ⚙  ::add-path:: /opt/hostedtoolcache/node/18.12.1/x64/bin
[test/test] ⭐ Run Main debug 0
[test/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1] user= workdir=
| PATH=/opt/hostedtoolcache/node/18.12.1/x64/bin:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[test/test]   ✅  Success - Main debug 0
[test/test] ⭐ Run Main fea/changelog-action@v1
[test/test]   🐳  docker cp src=/home/markusw/.cache/act/fea-changelog-action@v1/ dst=/var/run/act/actions/fea-changelog-action@v1/
[test/test] ⭐ Run Main Create changelog
[test/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/changelog-composite-generate.sh] user= workdir=
| fatal: not a git repository (or any parent up to mount point /home/markusw/source/xxx/source)
| Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
| Processing commits
| fatal: not a git repository (or any parent up to mount point /home/markusw/source/xxx/source)
| Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[test/test]   ❓  ::group::Changelog
| 
[test/test]   ❓  ::endgroup::
[test/test]   ⚙  ::set-output:: content=
[test/test]   ✅  Success - Main Create changelog
[test/test]   ⚙  ::set-output:: content=
[test/test]   ✅  Success - Main fea/changelog-action@v1
[test/test] ⭐ Run Main debug 1
[test/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir=
| PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[test/test]   ✅  Success - Main debug 1
[test/test] ⭐ Run Post fea/changelog-action@v1
[test/test]   🐳  docker cp src=/home/markusw/.cache/act/fea-changelog-action@v1/ dst=/var/run/act/actions/fea-changelog-action@v1/
[test/test]   ✅  Success - Post fea/changelog-action@v1
[test/test] ⭐ Run Post actions/setup-node@v3
[test/test]   🐳  docker exec cmd=[node /var/run/act/actions/actions-setup-node@v3/dist/cache-save/index.js] user= workdir=
[test/test]   💬  ::debug::Caching for '' is not supported
[test/test]   ✅  Success - Post actions/setup-node@v3
[test/test] 🏁  Job succeeded

Additional information

No response

Originally created by @KnisterPeter on GitHub (Dec 20, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1528 ### Bug report info ```plain text act version: 0.2.34-18-g4989f44 GOOS: linux GOARCH: amd64 NumCPU: 12 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/markusw/.actrc: -P ubuntu-latest=node:12-buster-slim -P ubuntu-20.04=node:12-buster-slim -P ubuntu-18.04=node:12-buster-slim -P ubuntu-16.04=node:12-stretch-slim Build info: Go version: go1.19.4 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -compiler: gc -ldflags: -X main.version=0.2.34-18-g4989f44 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: linux GOAMD64: v1 Docker Engine: Engine version: 20.10.21+dfsg1 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Debian GNU/Linux bookworm/sid OS type: linux OS version: OS arch: x86_64 OS kernel: 6.0.0-5-amd64 OS CPU: 12 OS memory: 31734 MB Security options: name=apparmor name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act ``` ### Describe issue The PATH variable is overwritten (or reset) when an action is executed wich creates some output. The workflow below prints the PATH in two places: 1. after `actions/setup-node` and the node bins are in the PATH 2. after the `fea/changelog-action`. In that place the PATH was reset. The changelog actions is private, but in essence it just defines an output string. It does not install tools or modifies the PATH. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: test on: push jobs: test: runs-on: ubuntu-latest steps: - uses: actions/setup-node@v3 with: node-version: 18 - name: debug 0 run: | echo PATH=$PATH - id: changelog uses: fea/changelog-action@v1 - name: debug 1 run: | echo PATH=$PATH ``` ### Relevant log output ```sh [test/test] ⭐ Run Pre fea/changelog-action@v1 [test/test] ✅ Success - Pre fea/changelog-action@v1 [test/test] ⭐ Run Main actions/setup-node@v3 [test/test] 🐳 docker cp src=/home/markusw/.cache/act/actions-setup-node@v3/ dst=/var/run/act/actions/actions-setup-node@v3/ [test/test] 🐳 docker exec cmd=[node /var/run/act/actions/actions-setup-node@v3/dist/setup/index.js] user= workdir= [test/test] 💬 ::debug::isExplicit: [test/test] 💬 ::debug::explicit? false [test/test] 💬 ::debug::evaluating 0 versions [test/test] 💬 ::debug::match not found | Attempting to download 18... [test/test] 💬 ::debug::No manifest cached [test/test] 💬 ::debug::Getting manifest from actions/node-versions@main [test/test] 💬 ::debug::check 18.12.1 satisfies 18 [test/test] 💬 ::debug::x64===x64 && darwin===linux [test/test] 💬 ::debug::x64===x64 && linux===linux [test/test] 💬 ::debug::matched 18.12.1 | Acquiring 18.12.1 - x64 from https://github.com/actions/node-versions/releases/download/18.12.1-3486235546/node-18.12.1-linux-x64.tar.gz [test/test] 💬 ::debug::Downloading https://github.com/actions/node-versions/releases/download/18.12.1-3486235546/node-18.12.1-linux-x64.tar.gz [test/test] 💬 ::debug::Destination /tmp/13b3dc68-7093-4428-bcee-91a6101f7fc9 [test/test] 💬 ::debug::download complete | Extracting ... [test/test] 💬 ::debug::Checking tar --version [test/test] 💬 ::debug::tar (GNU tar) 1.30%0ACopyright (C) 2017 Free Software Foundation, Inc.%0ALicense GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.%0AThis is free software: you are free to change and redistribute it.%0AThere is NO WARRANTY, to the extent permitted by law.%0A%0AWritten by John Gilmore and Jay Fenlason. | [command]/usr/bin/tar xz --strip 1 --warning=no-unknown-keyword -C /tmp/581a5375-8560-427c-a875-2cb808147a53 -f /tmp/13b3dc68-7093-4428-bcee-91a6101f7fc9 | Adding to the cache ... [test/test] 💬 ::debug::Caching tool node 18.12.1 x64 [test/test] 💬 ::debug::source dir: /tmp/581a5375-8560-427c-a875-2cb808147a53 [test/test] 💬 ::debug::destination /opt/hostedtoolcache/node/18.12.1/x64 [test/test] 💬 ::debug::finished caching tool | Done [test/test] ❓ ::group::Environment details | node: v18.12.1 | | yarn: 1.22.19 | | npm: 8.19.2 | [test/test] ❓ ::endgroup:: [test/test] ❓ ##[add-matcher]/run/act/actions/actions-setup-node@v3/.github/tsc.json [test/test] ❓ ##[add-matcher]/run/act/actions/actions-setup-node@v3/.github/eslint-stylish.json [test/test] ❓ ##[add-matcher]/run/act/actions/actions-setup-node@v3/.github/eslint-compact.json [test/test] ✅ Success - Main actions/setup-node@v3 [test/test] ⚙ ::set-output:: node-version=v18.12.1 [test/test] ⚙ ::add-path:: /opt/hostedtoolcache/node/18.12.1/x64/bin [test/test] ⭐ Run Main debug 0 [test/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1] user= workdir= | PATH=/opt/hostedtoolcache/node/18.12.1/x64/bin:"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin [test/test] ✅ Success - Main debug 0 [test/test] ⭐ Run Main fea/changelog-action@v1 [test/test] 🐳 docker cp src=/home/markusw/.cache/act/fea-changelog-action@v1/ dst=/var/run/act/actions/fea-changelog-action@v1/ [test/test] ⭐ Run Main Create changelog [test/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/changelog-composite-generate.sh] user= workdir= | fatal: not a git repository (or any parent up to mount point /home/markusw/source/xxx/source) | Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). | Processing commits | fatal: not a git repository (or any parent up to mount point /home/markusw/source/xxx/source) | Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). [test/test] ❓ ::group::Changelog | [test/test] ❓ ::endgroup:: [test/test] ⚙ ::set-output:: content= [test/test] ✅ Success - Main Create changelog [test/test] ⚙ ::set-output:: content= [test/test] ✅ Success - Main fea/changelog-action@v1 [test/test] ⭐ Run Main debug 1 [test/test] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= | PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin [test/test] ✅ Success - Main debug 1 [test/test] ⭐ Run Post fea/changelog-action@v1 [test/test] 🐳 docker cp src=/home/markusw/.cache/act/fea-changelog-action@v1/ dst=/var/run/act/actions/fea-changelog-action@v1/ [test/test] ✅ Success - Post fea/changelog-action@v1 [test/test] ⭐ Run Post actions/setup-node@v3 [test/test] 🐳 docker exec cmd=[node /var/run/act/actions/actions-setup-node@v3/dist/cache-save/index.js] user= workdir= [test/test] 💬 ::debug::Caching for '' is not supported [test/test] ✅ Success - Post actions/setup-node@v3 [test/test] 🏁 Job succeeded ``` ### Additional information _No response_
kerem 2026-03-01 21:46:14 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@KnisterPeter commented on GitHub (Dec 20, 2022):

This looks like a regresssion from https://github.com/nektos/act/pull/1472.
When this commit is reverted the added test case will succeed and the PATH is not reset.

<!-- gh-comment-id:1359761187 --> @KnisterPeter commented on GitHub (Dec 20, 2022): This looks like a regresssion from https://github.com/nektos/act/pull/1472. When this commit is reverted the added test case will succeed and the PATH is not reset.
Author
Owner

@ChristopherHX commented on GitHub (Dec 20, 2022):

Sounds like an even older regression of ::add-path::, due to unification it expands GITHUB_PATH.

<!-- gh-comment-id:1359993493 --> @ChristopherHX commented on GitHub (Dec 20, 2022): Sounds like an even older regression of `::add-path::`, due to unification it expands GITHUB_PATH.
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#774
No description provided.