Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH is overwritten #1528

Closed
KnisterPeter opened this issue Dec 20, 2022 · 2 comments · Fixed by #1531
Closed

PATH is overwritten #1528

KnisterPeter opened this issue Dec 20, 2022 · 2 comments · Fixed by #1531
Labels
kind/bug Something isn't working

Comments

@KnisterPeter
Copy link
Member

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.

Link to GitHub repository

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

@KnisterPeter KnisterPeter added the kind/bug Something isn't working label Dec 20, 2022
KnisterPeter added a commit that referenced this issue Dec 20, 2022
@KnisterPeter
Copy link
Member Author

This looks like a regresssion from #1472.
When this commit is reverted the added test case will succeed and the PATH is not reset.

@ChristopherHX
Copy link
Contributor

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

github-actions bot pushed a commit to xing/act that referenced this issue Dec 21, 2022
github-actions bot pushed a commit to xing/act that referenced this issue Dec 26, 2022
github-actions bot pushed a commit to xing/act that referenced this issue Jan 2, 2023
@mergify mergify bot closed this as completed in #1531 Jan 10, 2023
mergify bot added a commit that referenced this issue Jan 10, 2023
* test: define test case of path issues

Test case for #1528

* test: add multi arch grep

* fix: Always use current ExtraPath

* replace setup-node with run step

* Update push.yml

* yaml mistake

Co-authored-by: Markus Wolf <mail@markus-wolf.de>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants