act icon indicating copy to clipboard operation
act copied to clipboard

runner.arch is incorrect when overriding architecture with --container-architecture

Open cedws opened this issue 8 months ago • 2 comments

Bug report info

act version:            0.2.77
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:           
	/Users/development/Library/Application Support/act/actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.24.2
	Module path:           github.com/nektos/act
	Main version:          v0.2.78-0.20250504121323-324bab61f056
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               arm64
		GOOS:                 darwin
		GOARM64:              v8.0
		vcs:                  git
		vcs.revision:         324bab61f056e7e103b142b4c2f8b3b34421d764
		vcs.time:             2025-05-04T12:13:23Z
		vcs.modified:         false
Docker Engine:
	Engine version:        27.5.1
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    OrbStack
	OS type:               linux
	OS version:            
	OS arch:               aarch64
	OS kernel:             6.12.15-orbstack-00304-gd0ddcf70447d
	OS CPU:                10
	OS memory:             12008 MB
	Security options:
		name=seccomp,profile=builtin
		name=cgroupns

Command used with act

act --container-architecture linux/amd64 -W test.yml -P catthehacker/ubuntu:act-latest

Describe issue

When using --container-architecture to specify the architecture to launch the runner with, the runner.arch variable is always the host's architecture.

Link to GitHub repository

No response

Workflow content

name: Test

on:
  workflow_dispatch:

jobs:
  setup-trivy:
    runs-on: ubuntu-latest

    steps:
      - run: echo ${{ runner.arch }}

Relevant log output

INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock'
[Test/setup-trivy] ⭐ Run Set up job
[Test/setup-trivy] 🚀  Start image=catthehacker/ubuntu:act-latest
[Test/setup-trivy]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform=linux/amd64 username= forcePull=true
[Test/setup-trivy]   🐳  docker create image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Test/setup-trivy]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Test/setup-trivy]   🐳  docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[Test/setup-trivy]   ✅  Success - Set up job
[Test/setup-trivy] ⭐ Run Main echo ARM64
[Test/setup-trivy]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/0] user= workdir=
| ARM64
[Test/setup-trivy]   ✅  Success - Main echo ARM64 [39.567708ms]
[Test/setup-trivy] ⭐ Run Complete job
[Test/setup-trivy] Cleaning up container for job setup-trivy
[Test/setup-trivy]   ✅  Success - Complete job
[Test/setup-trivy] 🏁  Job succeeded

Additional information

This was previously raised in #1549 but the ticket was autoclosed.

cedws avatar May 14 '25 10:05 cedws

I'm having a look into this but having a hard time tracking down where changes need to be made.

cedws avatar May 14 '25 10:05 cedws

I am experiencing the same issue with subosito/flutter-action@v2.

ppamorim avatar Jun 26 '25 09:06 ppamorim