[GH-ISSUE #2757] runner.arch is incorrect when overriding architecture with --container-architecture #1249

Open
opened 2026-03-01 21:49:56 +03:00 by kerem · 2 comments
Owner

Originally created by @cedws on GitHub (May 14, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2757

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.

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.

Originally created by @cedws on GitHub (May 14, 2025). Original GitHub issue: https://github.com/nektos/act/issues/2757 ### Bug report info ```plain text 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 ```sh 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 ```yml name: Test on: workflow_dispatch: jobs: setup-trivy: runs-on: ubuntu-latest steps: - run: echo ${{ runner.arch }} ``` ### Relevant log output ```sh 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.
Author
Owner

@cedws commented on GitHub (May 14, 2025):

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

<!-- gh-comment-id:2879722355 --> @cedws commented on GitHub (May 14, 2025): I'm having a look into this but having a hard time tracking down where changes need to be made.
Author
Owner

@ppamorim commented on GitHub (Jun 26, 2025):

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

<!-- gh-comment-id:3007779557 --> @ppamorim commented on GitHub (Jun 26, 2025): I am experiencing the same issue with `subosito/flutter-action@v2`.
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#1249
No description provided.