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

strategy max-parallel can't be parsed as '${{ }}' variable #2619

Open
BlackDex opened this issue Jan 15, 2025 · 0 comments
Open

strategy max-parallel can't be parsed as '${{ }}' variable #2619

BlackDex opened this issue Jan 15, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@BlackDex
Copy link
Contributor

Bug report info

n/a

Command used with act

act push -e <(echo '{"act":true}') -j act

Describe issue

Not able to use a variable for max-parallel

Link to GitHub repository

No response

Workflow content

on: ['push']
name: act

jobs:
  act:
    name: act
    runs-on: ubuntu-latest
    strategy:
      max-parallel: ${{ github.event.act && 1 || 4 }}
    steps:
      - name: Checkout Repo
        uses: actions/checkout@4

Relevant log output

DEBU[0000] Handling container host and socket           
DEBU[0000] Defaulting container socket to DOCKER_HOST   
INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' 
DEBU[0000] Loading environment from /data/tmp/.env      
DEBU[0000] Loading action inputs from /data/tmp/.input  
DEBU[0000] Loading secrets from /data/tmp/.secrets      
DEBU[0000] Loading vars from /data/tmp/.vars            
DEBU[0000] Evaluated matrix inclusions: map[]           
DEBU[0000] Loading workflows from '/data/tmp/.github/workflows' 
DEBU[0000] Loading workflows recursively                
DEBU[0000] Conditional GET for notices etag=74cb8271-a6cd-485f-898e-da55a0faed1f 
DEBU[0000] Found workflow 'act.yml' in '/data/tmp/.github/workflows/act.yml' 
DEBU[0000] Reading workflow '/data/tmp/.github/workflows/act.yml' 
DEBU[0000] Using first passed in arguments event for filtering: push 
DEBU[0000] Preparing plan with a job: act               
DEBU[0000] Using first passed in arguments event: push  
DEBU[0000] Planning job: act                            
DEBU[0000] Reading event.json from /dev/fd/63           
DEBU[0000] gc: 2025-01-15 11:28:20.736101255 +0100 CET m=+0.005007372  module=artifactcache
DEBU[0000] Plan Stages: [0xc00013ee58]                  
DEBU[0000] Stages Runs: [act]                           
DEBU[0000] Job.Name: act                                
DEBU[0000] Job.RawNeeds: {0 0    <nil> []    0 0}       
DEBU[0000] Job.RawRunsOn: {8 0 !!str ubuntu-latest  <nil> []    7 14} 
DEBU[0000] Job.Env: {0 0    <nil> []    0 0}            
DEBU[0000] Job.If: {0 0  success()  <nil> []    0 0}    
DEBU[0000] Job.Steps: Hello World                       
DEBU[0000] Job.TimeoutMinutes:                          
DEBU[0000] Job.Services: map[]                          
DEBU[0000] Job.Strategy: &{false 0  ${{ github.event.act && 1 || 4 }} {0 0    <nil> []    0 0}} 
DEBU[0000] Job.RawContainer: {0 0    <nil> []    0 0}   
DEBU[0000] Job.Defaults.Run.Shell:                      
DEBU[0000] Job.Defaults.Run.WorkingDirectory:           
DEBU[0000] Job.Outputs: map[]                           
DEBU[0000] Job.Uses:                                    
DEBU[0000] Job.With: map[]                              
DEBU[0000] Job.Result:                                  
DEBU[0000] Job.Strategy.FailFast: false                 
DEBU[0000] Job.Strategy.MaxParallel: 0                  
DEBU[0000] Job.Strategy.FailFastString:                 
DEBU[0000] Job.Strategy.MaxParallelString: ${{ github.event.act && 1 || 4 }} 
DEBU[0000] Job.Strategy.RawMatrix: {0 0    <nil> []    0 0} 
WARN[0000] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found 
DEBU[0000] Loading revision from git directory          
WARN[0000] unable to get git ref: reference not found   
WARN[0000] unable to get git revision: reference not found 
WARN[0000] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found 
DEBU[0000] Loading revision from git directory          
WARN[0000] unable to get git ref: reference not found   
WARN[0000] unable to get git revision: reference not found 
DEBU[0000]                                              
ERRO[0000] Failed to parse 'max-parallel' option: strconv.Atoi: parsing "${{ github.event.act && 1 || 4 }}": invalid syntax 
DEBU[0000] Job Matrices: [map[]]                        
DEBU[0000] Runner Matrices: map[]                       
DEBU[0000] Final matrix after applying user inclusions '[map[]]' 
WARN[0000] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found 
DEBU[0000] Loading revision from git directory          
WARN[0000] unable to get git ref: reference not found   
WARN[0000] unable to get git revision: reference not found 
DEBU[0000] Detected CPUs: 16                            
DEBU[0000] Parallel tasks (0) below minimum, setting to 1 
[act/act] [DEBUG] evaluating expression 'success()'
[act/act] [DEBUG] expression 'success()' evaluated to 'true'
[act/act] 🚀  Start image=catthehacker/ubuntu:act-latest
DEBU[0000] Parallel tasks (0) below minimum, setting to 1 
[act/act]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[act/act] [DEBUG]   🐳  docker pull catthehacker/ubuntu:act-latest
[act/act] [DEBUG] Image exists? true
DEBU[0000] Parallel tasks (0) below minimum, setting to 1 
[act/act]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[act/act] [DEBUG] Common container.Config ==> &{Hostname: Domainname: User: AttachStdin:false AttachStdout:false AttachStderr:false ExposedPorts:map[] Tty:true OpenStdin:false StdinOnce:false Env:[RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=X64 RUNNER_TEMP=/tmp LANG=C.UTF-8] Cmd:[] Healthcheck:<nil> ArgsEscaped:false Image:catthehacker/ubuntu:act-latest Volumes:map[] WorkingDir:/data/tmp Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal: StopTimeout:<nil> Shell:[]}
[act/act] [DEBUG] Common container.HostConfig ==> &{Binds:[/var/run/docker.sock:/var/run/docker.sock] ContainerIDFile: LogConfig:{Type: Config:map[]} NetworkMode:host PortBindings:map[] RestartPolicy:{Name: MaximumRetryCount:0} AutoRemove:false VolumeDriver: VolumesFrom:[] ConsoleSize:[0 0] Annotations:map[] CapAdd:[] CapDrop:[] CgroupnsMode: DNS:[] DNSOptions:[] DNSSearch:[] ExtraHosts:[] GroupAdd:[] IpcMode: Cgroup: Links:[] OomScoreAdj:0 PidMode: Privileged:false PublishAllPorts:false ReadonlyRootfs:false SecurityOpt:[] StorageOpt:map[] Tmpfs:map[] UTSMode: UsernsMode: ShmSize:0 Sysctls:map[] Runtime: Isolation: Resources:{CPUShares:0 Memory:0 NanoCPUs:0 CgroupParent: BlkioWeight:0 BlkioWeightDevice:[] BlkioDeviceReadBps:[] BlkioDeviceWriteBps:[] BlkioDeviceReadIOps:[] BlkioDeviceWriteIOps:[] CPUPeriod:0 CPUQuota:0 CPURealtimePeriod:0 CPURealtimeRuntime:0 CpusetCpus: CpusetMems: Devices:[] DeviceCgroupRules:[] DeviceRequests:[] KernelMemory:0 KernelMemoryTCP:0 MemoryReservation:0 MemorySwap:0 MemorySwappiness:<nil> OomKillDisable:<nil> PidsLimit:<nil> Ulimits:[] CPUCount:0 CPUPercent:0 IOMaximumIOps:0 IOMaximumBandwidth:0} Mounts:[{Type:volume Source:act-toolcache Target:/opt/hostedtoolcache ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-act-act-a7e3e9f322c2ffcdbd1fffb522ce1ac032fc9c66612f8605bf6db6517b770dc7-env Target:/var/run/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-act-act-a7e3e9f322c2ffcdbd1fffb522ce1ac032fc9c66612f8605bf6db6517b770dc7 Target:/data/tmp ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>}] MaskedPaths:[] ReadonlyPaths:[] Init:<nil>}
[act/act] [DEBUG] input.NetworkAliases ==> [act]
[act/act] [DEBUG] Created container name=act-act-act-a7e3e9f322c2ffcdbd1fffb522ce1ac032fc9c66612f8605bf6db6517b770dc7 id=3d2442e777112f252574403b46448ec19418fa2acc0c91b963604341a5881b54 from image catthehacker/ubuntu:act-latest (platform: )
[act/act] [DEBUG] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=X64 RUNNER_TEMP=/tmp LANG=C.UTF-8]
[act/act]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[act/act] [DEBUG] Starting container: 3d2442e777112f252574403b46448ec19418fa2acc0c91b963604341a5881b54
[act/act] [DEBUG] Started container: 3d2442e777112f252574403b46448ec19418fa2acc0c91b963604341a5881b54
[act/act] [DEBUG] Writing entry to tarball workflow/event.json len:13
[act/act] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[act/act] [DEBUG] Extracting content to '/var/run/act/'
DEBU[0000] Parallel tasks (0) below minimum, setting to 1 
[act/act]   🐳  docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[act/act] [DEBUG] Exec command '[node --no-warnings -e console.log(process.execPath)]'
[act/act] [DEBUG] Working directory '/data/tmp'
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://192.168.0.196:41803/ CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:act GITHUB_REF:refs/heads/master GITHUB_REF_NAME:master GITHUB_REF_TYPE:branch GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ATTEMPT:1 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA: GITHUB_WORKFLOW:act GITHUB_WORKSPACE:/data/tmp ImageOS:ubuntu20 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:]
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] [DEBUG] evaluating expression ''
[act/act] [DEBUG] expression '' evaluated to 'true'
[act/act] ⭐ Run Main Hello World
[act/act] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
[act/act] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
[act/act] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
[act/act] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[act/act] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
[act/act] [DEBUG] Extracting content to '/var/run/act'
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
[act/act] [DEBUG] expression 'echo "Hello World ${{ github.event.act }}"
' rewritten to 'format('echo "Hello World {0}"
', github.event.act)'
[act/act] [DEBUG] evaluating expression 'format('echo "Hello World {0}"
', github.event.act)'
[act/act] [DEBUG] expression 'format('echo "Hello World {0}"
', github.event.act)' evaluated to '%!t(string=echo "Hello World true"
)'
[act/act] [DEBUG] Wrote command 

echo "Hello World true"


 to 'workflow/0'
[act/act] [DEBUG] Writing entry to tarball workflow/0 len:26
[act/act] [DEBUG] Extracting content to '/var/run/act'
[act/act]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/0] user= workdir=
[act/act] [DEBUG] Exec command '[bash -e /var/run/act/workflow/0]'
[act/act] [DEBUG] Working directory '/data/tmp'
| Hello World true
[act/act]   ✅  Success - Main Hello World
[act/act] Cleaning up container for job act
[act/act] [DEBUG] Removed container: 3d2442e777112f252574403b46448ec19418fa2acc0c91b963604341a5881b54
[act/act] [DEBUG]   🐳  docker volume rm act-act-act-a7e3e9f322c2ffcdbd1fffb522ce1ac032fc9c66612f8605bf6db6517b770dc7
[act/act] [DEBUG]   🐳  docker volume rm act-act-act-a7e3e9f322c2ffcdbd1fffb522ce1ac032fc9c66612f8605bf6db6517b770dc7-env
[act/act] 🏁  Job succeeded
[act/act] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /data/tmp): remote not found
[act/act] [DEBUG] Loading revision from git directory
[act/act] unable to get git ref: reference not found
[act/act] unable to get git revision: reference not found
DEBU[0001] Saving notices etag=74cb8271-a6cd-485f-898e-da55a0faed1f 
DEBU[0001] No new notices

Additional information

While currently the effect is the same for me, as act will set it to 1 currently, it's probably better if it is able to parse the string and provide the correct value.

@BlackDex BlackDex added the kind/bug Something isn't working label Jan 15, 2025
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

No branches or pull requests

1 participant