act version: 0.2.54
GOOS: darwin
GOARCH: arm64
NumCPU: 12
Docker host: DOCKER_HOST environment variable is not set
Sockets found:
/var/run/docker.sock
$HOME/.docker/run/docker.sock
Config files:
/Users/jonj/.actrc:
-P ubuntu-latest=node:16-buster-slim
-P ubuntu-22.04=node:16-bullseye-slim
-P ubuntu-20.04=node:16-buster-slim
-P ubuntu-18.04=node:16-buster-slim
Build info:
Go version: go1.21.4
Module path: command-line-arguments
Main version:
Main path:
Main checksum:
Build settings:
-buildmode: exe
-compiler: gc
-ldflags: -X main.version=0.2.54
DefaultGODEBUG: panicnil=1
CGO_ENABLED: 1
CGO_CFLAGS:
CGO_CPPFLAGS:
CGO_CXXFLAGS:
CGO_LDFLAGS:
GOARCH: arm64
GOOS: darwin
Docker Engine:
Engine version: 24.0.6
Engine runtime: runc
Cgroup version: 2
Cgroup driver: cgroupfs
Storage driver: overlay2
Registry URI: https://index.docker.io/v1/
OS: Docker Desktop
OS type: linux
OS version:
OS arch: aarch64
OS kernel: 6.4.16-linuxkit
OS CPU: 12
OS memory: 7844 MB
Security options:
name=seccomp,profile=unconfined
name=cgroupns
Command used with act
act -W .github/workflows/sample.yml -v
Describe issue
If you attempt to use a local action outside the workspace, act is unable to resolve it and emits a file does not exist error. It looks like getContainerActionPaths assumes local actions live under the $GITHUB_WORKSPACE, so it ends up looking for them in a nonexistent path like $GITHUB_WORKSPACE/previously/absolute/path/to/action.
These workflows are able to run successfully on GitHub.
Rationale
This is a bit of an edge case, but I've run into this in an monorepo where some actions call other actions locally. The tl;dr: is that one composite action determines its own location via github.action_path, and then uses that to dynamically call other actions from the same checkout (via dynamic-uses). This way I can ensure that I use the exact same version for all actions, and that it works whether I'm using the actions from the current repo or from another one.
Currently this all works fine when running on GitHub. When running under act, it works when I use the top-level action via local checkout, but it fails when I use it via ref, since it resolves the other actions to paths outside the workspace. To better illustrate what's happening, actions live under the actions subdirectory, and my top-level actions do something like this:
steps:
- name: Determine actions path
env:
github_action_path: ${{ github.action_path }}
run: echo "my_actions_path=./$(realpath --relative-to="$GITHUB_WORKSPACE" "$github_action_path"/../..)" >> "$GITHUB_ENV"
# if the current action was invoked from a local checkout, this will be something like:
# "./."
# if the current action was invoked by ref, this will be something like:
# "./../../_actions/Org/repo/sha" (GitHub), or
# "./../../../../run/act/actions/Org-repo-actions-my-action@sha" (act)
shell: bash
- name: Call some-action
uses: jenseng/dynamic-uses@v1
with:
uses: ${{ env.my_actions_path }}/actions/some-action
- name: Call another-action
uses: jenseng/dynamic-uses@v1
with:
uses: ${{ env.my_actions_path }}/actions/another-action
While another approach might be to use the github.action_ref, I'd like to be able to use/test actions locally without needing the ref to exist (e.g. when testing changes locally via act).
Bug report info
Command used with act
Describe issue
If you attempt to use a local action outside the workspace, act is unable to resolve it and emits a
file does not exist
error. It looks likegetContainerActionPaths
assumes local actions live under the$GITHUB_WORKSPACE
, so it ends up looking for them in a nonexistent path like$GITHUB_WORKSPACE/previously/absolute/path/to/action
.These workflows are able to run successfully on GitHub.
Rationale
This is a bit of an edge case, but I've run into this in an monorepo where some actions call other actions locally. The tl;dr: is that one composite action determines its own location via
github.action_path
, and then uses that to dynamically call other actions from the same checkout (via dynamic-uses). This way I can ensure that I use the exact same version for all actions, and that it works whether I'm using the actions from the current repo or from another one.Currently this all works fine when running on GitHub. When running under act, it works when I use the top-level action via local checkout, but it fails when I use it via ref, since it resolves the other actions to paths outside the workspace. To better illustrate what's happening, actions live under the
actions
subdirectory, and my top-level actions do something like this:While another approach might be to use the
github.action_ref
, I'd like to be able to use/test actions locally without needing the ref to exist (e.g. when testing changes locally via act).Link to GitHub repository
https://github.com/jenseng/dynamic-uses/actions/runs/7036492016/job/19149221462
Workflow content
Relevant log output
Additional information
No response