[GH-ISSUE #2483] If conditions not evaluated correctly in with re-usable workflows #1148

Closed
opened 2026-03-01 21:49:17 +03:00 by kerem · 4 comments
Owner

Originally created by @donatobarone on GitHub (Oct 10, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2483

Bug report info

NA

Command used with act

act workflow_dispatch -W .github/workflows/workflow_1.yml --eventpath=payload.event -P ubuntu-22.04=fds-cif-ubuntu-act

Describe issue

When using reusable workflows context, specifically the inputs seem to be lost when an if statement is being evaluated. I am specifically referring to the call in action_1 which tries to call action_2 with the if statement. It seems that at this point when the evaluator is being setup for that step to determine if it is enabled or not, the inputs are the ones from the called action which is action_2, but not from action_1. Specifically in this I am assuming something is happening that is using the wrong env or anyway is not appending the caller ones. From the debugger I can see that the only INPUT_ env variable when evaluating that condition ${{ inputs.first_condition == 'true' }} is INPUT_INPUT_FOR_ACTION_2 and so the evaluation returns a false rather than a true.

No response

Workflow content

workflow_1.yml

name: Workflow 1

on:
    workflow_dispatch:
        inputs:
            first_condition_root:
                required: false
                default: 'true'

jobs:
    root_job:
        runs-on: ubuntu-22.04
        steps:
            - name: Call action 1
              uses: ./.github/actions/action_1
              with:
                first_condition: ${{ github.event.inputs.first_condition_root }}

action_1/action.yml

name: Action 1
inputs:
  first_condition:
    description: 'Whether to call the other action or not'
    required: false
    default: 'true'
  
runs:
  using: "composite"
  steps:
   
    - name: call action 2 within action 1
      if: ${{ inputs.first_condition == 'true' }}
      uses: ./.github/actions/action_2
      with:
        input_for_action_2: "from action 1"
   

action_2/action.yml

name: Action 2
inputs:
   input_for_action_2:
      required: true

runs:
  using: "composite"
  steps:
    - name: execute_within_action_2
      run: |
        echo "finally in action 2"
      shell: bash

Relevant log output

time="2024-10-10T16:46:03+01:00" level=debug msg="Handling container host and socket"
time="2024-10-10T16:46:03+01:00" level=debug msg="Defaulting container socket to DOCKER_HOST"
time="2024-10-10T16:46:03+01:00" level=info msg="Using docker host 'unix:///Users/dbarone/.colima/docker.sock', and daemon socket 'unix:///Users/dbarone/.colima/docker.sock'"
level=warning msg= ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠
time="2024-10-10T16:46:03+01:00" level=debug msg="Loading environment from /Users/dbarone/Projects/act/.env"
time="2024-10-10T16:46:03+01:00" level=debug msg="Conditional GET for notices etag=af54dc38-2430-47f2-91c8-dfc0e178ab6e"
time="2024-10-10T16:46:03+01:00" level=debug msg="Loading action inputs from /Users/dbarone/Projects/act/.input"
time="2024-10-10T16:46:03+01:00" level=debug msg="Loading secrets from /Users/dbarone/Projects/act/.secrets"
time="2024-10-10T16:46:03+01:00" level=debug msg="Loading vars from /Users/dbarone/Projects/act/.vars"
time="2024-10-10T16:46:03+01:00" level=debug msg="Evaluated matrix inclusions: map[]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Loading workflow '/Users/dbarone/Projects/act/.github/workflows/workflow_1.yml'"
time="2024-10-10T16:46:03+01:00" level=debug msg="Reading workflow '/Users/dbarone/Projects/act/.github/workflows/workflow_1.yml'"
time="2024-10-10T16:46:03+01:00" level=debug msg="Using first passed in arguments event for filtering: workflow_dispatch"
time="2024-10-10T16:46:03+01:00" level=debug msg="Preparing plan for a event: workflow_dispatch"
time="2024-10-10T16:46:03+01:00" level=debug msg="Using first passed in arguments event: workflow_dispatch"
time="2024-10-10T16:46:03+01:00" level=debug msg="Planning jobs for event: workflow_dispatch"
time="2024-10-10T16:46:03+01:00" level=debug msg="Reading event.json from /Users/dbarone/Projects/managed-datahub-metadata/payload.event"
time="2024-10-10T16:46:03+01:00" level=debug msg="gc: 2024-10-10 16:46:03.209812 +0100 BST m=+0.014061501" module=artifactcache
time="2024-10-10T16:46:03+01:00" level=debug msg="Plan Stages: [0x140003a1d58]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Stages Runs: [root_job]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Name: root_job"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.RawNeeds: {0 0    <nil> []    0 0}"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.RawRunsOn: {8 0 !!str ubuntu-22.04  <nil> []    12 18}"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Env: {0 0    <nil> []    0 0}"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.If: {0 0  success()  <nil> []    0 0}"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Steps: Call action 1"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.TimeoutMinutes: "
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Services: map[]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Strategy: <nil>"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.RawContainer: {0 0    <nil> []    0 0}"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Defaults.Run.Shell: "
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Defaults.Run.WorkingDirectory: "
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Outputs: map[]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Uses: "
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.With: map[]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Result: "
time="2024-10-10T16:46:03+01:00" level=debug msg="Empty Strategy, matrixes=[map[]]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Job Matrices: [map[]]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Runner Matrices: map[]"
time="2024-10-10T16:46:03+01:00" level=debug msg="Final matrix after applying user inclusions '[map[]]'"
time="2024-10-10T16:46:03+01:00" level=debug msg="Detected CPUs: 10"
[Workflow 1/root_job] [DEBUG] evaluating expression 'success()'
[Workflow 1/root_job] [DEBUG] expression 'success()' evaluated to 'true'
[Workflow 1/root_job] 🚀  Start image=fds-cif-ubuntu-act
time="2024-10-10T16:46:03+01:00" level=debug msg="Parallel tasks (0) below minimum, setting to 1"
[Workflow 1/root_job]   🐳  docker pull image=fds-cif-ubuntu-act platform= username= forcePull=false
[Workflow 1/root_job] [DEBUG]   🐳  docker pull fds-cif-ubuntu-act
[Workflow 1/root_job] [DEBUG] Image exists? true
time="2024-10-10T16:46:03+01:00" level=debug msg="Parallel tasks (0) below minimum, setting to 1"
[Workflow 1/root_job]   🐳  docker create image=fds-cif-ubuntu-act platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Workflow 1/root_job] [DEBUG] Common container.Config ==> &{Hostname: Domainname: User: AttachStdin:false AttachStdout:false AttachStderr:false ExposedPorts:map[] Tty:false OpenStdin:false StdinOnce:false Env:[RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=ARM64 RUNNER_TEMP=/tmp LANG=C.UTF-8] Cmd:[] Healthcheck:<nil> ArgsEscaped:false Image:fds-cif-ubuntu-act Volumes:map[] WorkingDir:/Users/dbarone/Projects/act Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal: StopTimeout:<nil> Shell:[]}
[Workflow 1/root_job] [DEBUG] Common container.HostConfig ==> &{Binds:[/Users/dbarone/.colima/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-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd-env Target:/var/run/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd Target:/Users/dbarone/Projects/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>}] MaskedPaths:[] ReadonlyPaths:[] Init:<nil>}
[Workflow 1/root_job] [DEBUG] input.NetworkAliases ==> [root_job]
[Workflow 1/root_job] [DEBUG] Created container name=act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd id=1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500 from image fds-cif-ubuntu-act (platform: )
[Workflow 1/root_job] [DEBUG] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=ARM64 RUNNER_TEMP=/tmp LANG=C.UTF-8]
[Workflow 1/root_job]   🐳  docker run image=fds-cif-ubuntu-act platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[Workflow 1/root_job] [DEBUG] Starting container: 1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500
[Workflow 1/root_job] [DEBUG] Started container: 1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/event.json len:313
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[Workflow 1/root_job] [DEBUG] Extracting content to '/var/run/act/'
time="2024-10-10T16:46:03+01:00" level=debug msg="Parallel tasks (0) below minimum, setting to 1"
[Workflow 1/root_job]   🐳  docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[Workflow 1/root_job] [DEBUG] Exec command '[node --no-warnings -e console.log(process.execPath)]'
[Workflow 1/root_job] [DEBUG] Working directory '/Users/dbarone/Projects/act'
[Workflow 1/root_job] [DEBUG] expression '${{ github.event.inputs.first_condition_root }}' rewritten to 'format('{0}', github.event.inputs.first_condition_root)'
[Workflow 1/root_job] [DEBUG] evaluating expression 'format('{0}', github.event.inputs.first_condition_root)'
[Workflow 1/root_job] [DEBUG] expression 'format('{0}', github.event.inputs.first_condition_root)' evaluated to '%!t(string=true)'
[Workflow 1/root_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.18.120.117:61873/ 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://github.factset.com/api/v3 GITHUB_BASE_REF: GITHUB_EVENT_NAME:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://github.factset.com/api/graphql GITHUB_HEAD_REF: GITHUB_JOB:root_job GITHUB_REF:refs/heads/nektos/act-test-donatos-version GITHUB_REF_NAME:nektos/act-test-donatos-version GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:FactSet/managed-datahub-metadata GITHUB_REPOSITORY_OWNER:FactSet GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.factset.com GITHUB_SHA:d58bc994451ae64473155cdffbb23c86ae22b15a GITHUB_WORKFLOW:Workflow 1 GITHUB_WORKSPACE:/Users/dbarone/Projects/act INPUT_FIRST_CONDITION:true ImageOS:ubuntu22 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: SHA_REF:d58bc994451ae64473155cdffbb23c86ae22b15a]
[Workflow 1/root_job] [DEBUG] evaluating expression ''
[Workflow 1/root_job] [DEBUG] expression '' evaluated to 'true'
[Workflow 1/root_job] ⭐ Run Main Call action 1
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
[Workflow 1/root_job] [DEBUG] Extracting content to '/var/run/act'
[Workflow 1/root_job] [DEBUG] Read action &{Action 1   map[first_condition:{Whether to call the other action or not false true}] map[] {composite map[]   always()  always()     [] [{ {8 0 !!str ${{ inputs.first_condition == 'true' }}  <nil> []    13 11} call action 2 within action 1 ./.github/actions/action_2    {0 0    <nil> []    0 0} map[input_for_action_2:from action 1]  }]} { }} from 'Unknown'
[Workflow 1/root_job] [DEBUG] About to run action &{Action 1   map[first_condition:{Whether to call the other action or not false true}] map[] {composite map[]   always()  always()     [] [{ {8 0 !!str ${{ inputs.first_condition == 'true' }}  <nil> []    13 11} call action 2 within action 1 ./.github/actions/action_2    {0 0    <nil> []    0 0} map[input_for_action_2:from action 1]  }]} { }}
[Workflow 1/root_job] [DEBUG] type=local-action actionDir=/Users/dbarone/Projects/act/.github/actions/action_1 actionPath= workdir=/Users/dbarone/Projects/act actionCacheDir=/Users/dbarone/.cache/act actionName=./.github/actions/action_1 containerActionDir=/Users/dbarone/Projects/act/.github/actions/action_1
[Workflow 1/root_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.18.120.117:61873/ CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH:/Users/dbarone/Projects/act/.github/actions/action_1 GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://github.factset.com/api/v3 GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://github.factset.com/api/graphql GITHUB_HEAD_REF: GITHUB_JOB:root_job GITHUB_OUTPUT:/var/run/act/workflow/outputcmd.txt GITHUB_PATH:/var/run/act/workflow/pathcmd.txt GITHUB_REF:refs/heads/nektos/act-test-donatos-version GITHUB_REF_NAME:nektos/act-test-donatos-version GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:FactSet/managed-datahub-metadata GITHUB_REPOSITORY_OWNER:FactSet GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.factset.com GITHUB_SHA:d58bc994451ae64473155cdffbb23c86ae22b15a GITHUB_STATE:/var/run/act/workflow/statecmd.txt GITHUB_STEP_SUMMARY:/var/run/act/workflow/SUMMARY.md GITHUB_WORKFLOW:Workflow 1 GITHUB_WORKSPACE:/Users/dbarone/Projects/act INPUT_INPUT_FOR_ACTION_2:from action 1 ImageOS:ubuntu22 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: SHA_REF:d58bc994451ae64473155cdffbb23c86ae22b15a]
[Workflow 1/root_job] [DEBUG] evaluating expression '${{ inputs.first_condition == 'true' }}'
[Workflow 1/root_job] [DEBUG] expression '${{ inputs.first_condition == 'true' }}' evaluated to 'false'
[Workflow 1/root_job] [DEBUG] Skipping step 'call action 2 within action 1' due to '${{ inputs.first_condition == 'true' }}'
[Workflow 1/root_job]   ✅  Success - Main Call action 1
[Workflow 1/root_job] [DEBUG] expression '${{ github.event.inputs.first_condition_root }}' rewritten to 'format('{0}', github.event.inputs.first_condition_root)'
[Workflow 1/root_job] [DEBUG] evaluating expression 'format('{0}', github.event.inputs.first_condition_root)'
[Workflow 1/root_job] [DEBUG] expression 'format('{0}', github.event.inputs.first_condition_root)' evaluated to '%!t(string=true)'
[Workflow 1/root_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.18.120.117:61873/ 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://github.factset.com/api/v3 GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://github.factset.com/api/graphql GITHUB_HEAD_REF: GITHUB_JOB:root_job GITHUB_OUTPUT:/var/run/act/workflow/outputcmd.txt GITHUB_PATH:/var/run/act/workflow/pathcmd.txt GITHUB_REF:refs/heads/nektos/act-test-donatos-version GITHUB_REF_NAME:nektos/act-test-donatos-version GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:FactSet/managed-datahub-metadata GITHUB_REPOSITORY_OWNER:FactSet GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.factset.com GITHUB_SHA:d58bc994451ae64473155cdffbb23c86ae22b15a GITHUB_STATE:/var/run/act/workflow/statecmd.txt GITHUB_STEP_SUMMARY:/var/run/act/workflow/SUMMARY.md GITHUB_WORKFLOW:Workflow 1 GITHUB_WORKSPACE:/Users/dbarone/Projects/act INPUT_FIRST_CONDITION:true ImageOS:ubuntu22 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: SHA_REF:d58bc994451ae64473155cdffbb23c86ae22b15a]
[Workflow 1/root_job] [DEBUG] evaluating expression 'always()'
[Workflow 1/root_job] [DEBUG] expression 'always()' evaluated to 'true'
[Workflow 1/root_job] ⭐ Run Post Call action 1
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
[Workflow 1/root_job] [DEBUG] Extracting content to '/var/run/act'
[Workflow 1/root_job] [DEBUG] run post step for 'Call action 1'
[Workflow 1/root_job] [DEBUG] skipping post step for 'call action 2 within action 1'; main step was skipped
[Workflow 1/root_job]   ✅  Success - Post Call action 1
[Workflow 1/root_job] Cleaning up container for job root_job
[Workflow 1/root_job] [DEBUG] Removed container: 1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500
[Workflow 1/root_job] [DEBUG]   🐳  docker volume rm act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd
[Workflow 1/root_job] [DEBUG]   🐳  docker volume rm act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd-env
[Workflow 1/root_job] 🏁  Job succeeded
time="2024-10-10T16:46:04+01:00" level=debug msg="Saving notices etag=dd1ce151-d50d-41c3-bed5-437511234789"

Additional information

In order to make this work locally I had to do a small change here, essentially when using reusable workflows locally it would try to get the code from the docker, but whilst using localrepository or just using local actions it would try to get those from the container but of course they are not there. So I have added an extra step in there to fetch the file from local

 else if err != nil {
		lreader, err := os.Open(spath)
		if err != nil {
			return nil, nil, fs.ErrNotExist
		}
		return lreader, lreader, nil
	}
Originally created by @donatobarone on GitHub (Oct 10, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2483 ### Bug report info ```plain text NA ``` ### Command used with act ```sh act workflow_dispatch -W .github/workflows/workflow_1.yml --eventpath=payload.event -P ubuntu-22.04=fds-cif-ubuntu-act ``` ### Describe issue When using reusable workflows context, specifically the inputs seem to be lost when an if statement is being evaluated. I am specifically referring to the call in action_1 which tries to call action_2 with the if statement. It seems that at this [point](https://github.com/nektos/act/blob/9142ed9bf7b8cf4f5c90b844c5b467ffaa54b233/pkg/runner/step.go#L264) when the evaluator is being setup for that step to determine if it is enabled or not, the inputs are the ones from the called action which is action_2, but not from action_1. Specifically in [this](https://github.com/nektos/act/blob/9142ed9bf7b8cf4f5c90b844c5b467ffaa54b233/pkg/runner/expression.go#L484) I am assuming something is happening that is using the wrong env or anyway is not appending the caller ones. From the debugger I can see that the only INPUT_ env variable when evaluating that condition ${{ inputs.first_condition == 'true' }} is INPUT_INPUT_FOR_ACTION_2 and so the evaluation returns a false rather than a true. ### Link to GitHub repository _No response_ ### Workflow content ```yml workflow_1.yml name: Workflow 1 on: workflow_dispatch: inputs: first_condition_root: required: false default: 'true' jobs: root_job: runs-on: ubuntu-22.04 steps: - name: Call action 1 uses: ./.github/actions/action_1 with: first_condition: ${{ github.event.inputs.first_condition_root }} action_1/action.yml name: Action 1 inputs: first_condition: description: 'Whether to call the other action or not' required: false default: 'true' runs: using: "composite" steps: - name: call action 2 within action 1 if: ${{ inputs.first_condition == 'true' }} uses: ./.github/actions/action_2 with: input_for_action_2: "from action 1" action_2/action.yml name: Action 2 inputs: input_for_action_2: required: true runs: using: "composite" steps: - name: execute_within_action_2 run: | echo "finally in action 2" shell: bash ``` ### Relevant log output ```sh time="2024-10-10T16:46:03+01:00" level=debug msg="Handling container host and socket" time="2024-10-10T16:46:03+01:00" level=debug msg="Defaulting container socket to DOCKER_HOST" time="2024-10-10T16:46:03+01:00" level=info msg="Using docker host 'unix:///Users/dbarone/.colima/docker.sock', and daemon socket 'unix:///Users/dbarone/.colima/docker.sock'" level=warning msg= ⚠ You are using Apple M-series chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠ time="2024-10-10T16:46:03+01:00" level=debug msg="Loading environment from /Users/dbarone/Projects/act/.env" time="2024-10-10T16:46:03+01:00" level=debug msg="Conditional GET for notices etag=af54dc38-2430-47f2-91c8-dfc0e178ab6e" time="2024-10-10T16:46:03+01:00" level=debug msg="Loading action inputs from /Users/dbarone/Projects/act/.input" time="2024-10-10T16:46:03+01:00" level=debug msg="Loading secrets from /Users/dbarone/Projects/act/.secrets" time="2024-10-10T16:46:03+01:00" level=debug msg="Loading vars from /Users/dbarone/Projects/act/.vars" time="2024-10-10T16:46:03+01:00" level=debug msg="Evaluated matrix inclusions: map[]" time="2024-10-10T16:46:03+01:00" level=debug msg="Loading workflow '/Users/dbarone/Projects/act/.github/workflows/workflow_1.yml'" time="2024-10-10T16:46:03+01:00" level=debug msg="Reading workflow '/Users/dbarone/Projects/act/.github/workflows/workflow_1.yml'" time="2024-10-10T16:46:03+01:00" level=debug msg="Using first passed in arguments event for filtering: workflow_dispatch" time="2024-10-10T16:46:03+01:00" level=debug msg="Preparing plan for a event: workflow_dispatch" time="2024-10-10T16:46:03+01:00" level=debug msg="Using first passed in arguments event: workflow_dispatch" time="2024-10-10T16:46:03+01:00" level=debug msg="Planning jobs for event: workflow_dispatch" time="2024-10-10T16:46:03+01:00" level=debug msg="Reading event.json from /Users/dbarone/Projects/managed-datahub-metadata/payload.event" time="2024-10-10T16:46:03+01:00" level=debug msg="gc: 2024-10-10 16:46:03.209812 +0100 BST m=+0.014061501" module=artifactcache time="2024-10-10T16:46:03+01:00" level=debug msg="Plan Stages: [0x140003a1d58]" time="2024-10-10T16:46:03+01:00" level=debug msg="Stages Runs: [root_job]" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Name: root_job" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.RawNeeds: {0 0 <nil> [] 0 0}" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.RawRunsOn: {8 0 !!str ubuntu-22.04 <nil> [] 12 18}" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Env: {0 0 <nil> [] 0 0}" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.If: {0 0 success() <nil> [] 0 0}" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Steps: Call action 1" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.TimeoutMinutes: " time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Services: map[]" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Strategy: <nil>" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.RawContainer: {0 0 <nil> [] 0 0}" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Defaults.Run.Shell: " time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Defaults.Run.WorkingDirectory: " time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Outputs: map[]" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Uses: " time="2024-10-10T16:46:03+01:00" level=debug msg="Job.With: map[]" time="2024-10-10T16:46:03+01:00" level=debug msg="Job.Result: " time="2024-10-10T16:46:03+01:00" level=debug msg="Empty Strategy, matrixes=[map[]]" time="2024-10-10T16:46:03+01:00" level=debug msg="Job Matrices: [map[]]" time="2024-10-10T16:46:03+01:00" level=debug msg="Runner Matrices: map[]" time="2024-10-10T16:46:03+01:00" level=debug msg="Final matrix after applying user inclusions '[map[]]'" time="2024-10-10T16:46:03+01:00" level=debug msg="Detected CPUs: 10" [Workflow 1/root_job] [DEBUG] evaluating expression 'success()' [Workflow 1/root_job] [DEBUG] expression 'success()' evaluated to 'true' [Workflow 1/root_job] 🚀 Start image=fds-cif-ubuntu-act time="2024-10-10T16:46:03+01:00" level=debug msg="Parallel tasks (0) below minimum, setting to 1" [Workflow 1/root_job] 🐳 docker pull image=fds-cif-ubuntu-act platform= username= forcePull=false [Workflow 1/root_job] [DEBUG] 🐳 docker pull fds-cif-ubuntu-act [Workflow 1/root_job] [DEBUG] Image exists? true time="2024-10-10T16:46:03+01:00" level=debug msg="Parallel tasks (0) below minimum, setting to 1" [Workflow 1/root_job] 🐳 docker create image=fds-cif-ubuntu-act platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [Workflow 1/root_job] [DEBUG] Common container.Config ==> &{Hostname: Domainname: User: AttachStdin:false AttachStdout:false AttachStderr:false ExposedPorts:map[] Tty:false OpenStdin:false StdinOnce:false Env:[RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=ARM64 RUNNER_TEMP=/tmp LANG=C.UTF-8] Cmd:[] Healthcheck:<nil> ArgsEscaped:false Image:fds-cif-ubuntu-act Volumes:map[] WorkingDir:/Users/dbarone/Projects/act Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal: StopTimeout:<nil> Shell:[]} [Workflow 1/root_job] [DEBUG] Common container.HostConfig ==> &{Binds:[/Users/dbarone/.colima/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-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd-env Target:/var/run/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd Target:/Users/dbarone/Projects/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>}] MaskedPaths:[] ReadonlyPaths:[] Init:<nil>} [Workflow 1/root_job] [DEBUG] input.NetworkAliases ==> [root_job] [Workflow 1/root_job] [DEBUG] Created container name=act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd id=1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500 from image fds-cif-ubuntu-act (platform: ) [Workflow 1/root_job] [DEBUG] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=ARM64 RUNNER_TEMP=/tmp LANG=C.UTF-8] [Workflow 1/root_job] 🐳 docker run image=fds-cif-ubuntu-act platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [Workflow 1/root_job] [DEBUG] Starting container: 1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500 [Workflow 1/root_job] [DEBUG] Started container: 1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/event.json len:313 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/envs.txt len:0 [Workflow 1/root_job] [DEBUG] Extracting content to '/var/run/act/' time="2024-10-10T16:46:03+01:00" level=debug msg="Parallel tasks (0) below minimum, setting to 1" [Workflow 1/root_job] 🐳 docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir= [Workflow 1/root_job] [DEBUG] Exec command '[node --no-warnings -e console.log(process.execPath)]' [Workflow 1/root_job] [DEBUG] Working directory '/Users/dbarone/Projects/act' [Workflow 1/root_job] [DEBUG] expression '${{ github.event.inputs.first_condition_root }}' rewritten to 'format('{0}', github.event.inputs.first_condition_root)' [Workflow 1/root_job] [DEBUG] evaluating expression 'format('{0}', github.event.inputs.first_condition_root)' [Workflow 1/root_job] [DEBUG] expression 'format('{0}', github.event.inputs.first_condition_root)' evaluated to '%!t(string=true)' [Workflow 1/root_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.18.120.117:61873/ 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://github.factset.com/api/v3 GITHUB_BASE_REF: GITHUB_EVENT_NAME:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://github.factset.com/api/graphql GITHUB_HEAD_REF: GITHUB_JOB:root_job GITHUB_REF:refs/heads/nektos/act-test-donatos-version GITHUB_REF_NAME:nektos/act-test-donatos-version GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:FactSet/managed-datahub-metadata GITHUB_REPOSITORY_OWNER:FactSet GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.factset.com GITHUB_SHA:d58bc994451ae64473155cdffbb23c86ae22b15a GITHUB_WORKFLOW:Workflow 1 GITHUB_WORKSPACE:/Users/dbarone/Projects/act INPUT_FIRST_CONDITION:true ImageOS:ubuntu22 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: SHA_REF:d58bc994451ae64473155cdffbb23c86ae22b15a] [Workflow 1/root_job] [DEBUG] evaluating expression '' [Workflow 1/root_job] [DEBUG] expression '' evaluated to 'true' [Workflow 1/root_job] ⭐ Run Main Call action 1 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/envs.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0 [Workflow 1/root_job] [DEBUG] Extracting content to '/var/run/act' [Workflow 1/root_job] [DEBUG] Read action &{Action 1 map[first_condition:{Whether to call the other action or not false true}] map[] {composite map[] always() always() [] [{ {8 0 !!str ${{ inputs.first_condition == 'true' }} <nil> [] 13 11} call action 2 within action 1 ./.github/actions/action_2 {0 0 <nil> [] 0 0} map[input_for_action_2:from action 1] }]} { }} from 'Unknown' [Workflow 1/root_job] [DEBUG] About to run action &{Action 1 map[first_condition:{Whether to call the other action or not false true}] map[] {composite map[] always() always() [] [{ {8 0 !!str ${{ inputs.first_condition == 'true' }} <nil> [] 13 11} call action 2 within action 1 ./.github/actions/action_2 {0 0 <nil> [] 0 0} map[input_for_action_2:from action 1] }]} { }} [Workflow 1/root_job] [DEBUG] type=local-action actionDir=/Users/dbarone/Projects/act/.github/actions/action_1 actionPath= workdir=/Users/dbarone/Projects/act actionCacheDir=/Users/dbarone/.cache/act actionName=./.github/actions/action_1 containerActionDir=/Users/dbarone/Projects/act/.github/actions/action_1 [Workflow 1/root_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.18.120.117:61873/ CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH:/Users/dbarone/Projects/act/.github/actions/action_1 GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://github.factset.com/api/v3 GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://github.factset.com/api/graphql GITHUB_HEAD_REF: GITHUB_JOB:root_job GITHUB_OUTPUT:/var/run/act/workflow/outputcmd.txt GITHUB_PATH:/var/run/act/workflow/pathcmd.txt GITHUB_REF:refs/heads/nektos/act-test-donatos-version GITHUB_REF_NAME:nektos/act-test-donatos-version GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:FactSet/managed-datahub-metadata GITHUB_REPOSITORY_OWNER:FactSet GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.factset.com GITHUB_SHA:d58bc994451ae64473155cdffbb23c86ae22b15a GITHUB_STATE:/var/run/act/workflow/statecmd.txt GITHUB_STEP_SUMMARY:/var/run/act/workflow/SUMMARY.md GITHUB_WORKFLOW:Workflow 1 GITHUB_WORKSPACE:/Users/dbarone/Projects/act INPUT_INPUT_FOR_ACTION_2:from action 1 ImageOS:ubuntu22 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: SHA_REF:d58bc994451ae64473155cdffbb23c86ae22b15a] [Workflow 1/root_job] [DEBUG] evaluating expression '${{ inputs.first_condition == 'true' }}' [Workflow 1/root_job] [DEBUG] expression '${{ inputs.first_condition == 'true' }}' evaluated to 'false' [Workflow 1/root_job] [DEBUG] Skipping step 'call action 2 within action 1' due to '${{ inputs.first_condition == 'true' }}' [Workflow 1/root_job] ✅ Success - Main Call action 1 [Workflow 1/root_job] [DEBUG] expression '${{ github.event.inputs.first_condition_root }}' rewritten to 'format('{0}', github.event.inputs.first_condition_root)' [Workflow 1/root_job] [DEBUG] evaluating expression 'format('{0}', github.event.inputs.first_condition_root)' [Workflow 1/root_job] [DEBUG] expression 'format('{0}', github.event.inputs.first_condition_root)' evaluated to '%!t(string=true)' [Workflow 1/root_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.18.120.117:61873/ 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://github.factset.com/api/v3 GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:workflow_dispatch GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://github.factset.com/api/graphql GITHUB_HEAD_REF: GITHUB_JOB:root_job GITHUB_OUTPUT:/var/run/act/workflow/outputcmd.txt GITHUB_PATH:/var/run/act/workflow/pathcmd.txt GITHUB_REF:refs/heads/nektos/act-test-donatos-version GITHUB_REF_NAME:nektos/act-test-donatos-version GITHUB_REF_TYPE:branch GITHUB_REPOSITORY:FactSet/managed-datahub-metadata GITHUB_REPOSITORY_OWNER:FactSet GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.factset.com GITHUB_SHA:d58bc994451ae64473155cdffbb23c86ae22b15a GITHUB_STATE:/var/run/act/workflow/statecmd.txt GITHUB_STEP_SUMMARY:/var/run/act/workflow/SUMMARY.md GITHUB_WORKFLOW:Workflow 1 GITHUB_WORKSPACE:/Users/dbarone/Projects/act INPUT_FIRST_CONDITION:true ImageOS:ubuntu22 RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: SHA_REF:d58bc994451ae64473155cdffbb23c86ae22b15a] [Workflow 1/root_job] [DEBUG] evaluating expression 'always()' [Workflow 1/root_job] [DEBUG] expression 'always()' evaluated to 'true' [Workflow 1/root_job] ⭐ Run Post Call action 1 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/envs.txt len:0 [Workflow 1/root_job] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0 [Workflow 1/root_job] [DEBUG] Extracting content to '/var/run/act' [Workflow 1/root_job] [DEBUG] run post step for 'Call action 1' [Workflow 1/root_job] [DEBUG] skipping post step for 'call action 2 within action 1'; main step was skipped [Workflow 1/root_job] ✅ Success - Post Call action 1 [Workflow 1/root_job] Cleaning up container for job root_job [Workflow 1/root_job] [DEBUG] Removed container: 1b7bc4fdfdcdbb34f28179498c094a1fb22f5bbda5d66ff3e29169d5efd4d500 [Workflow 1/root_job] [DEBUG] 🐳 docker volume rm act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd [Workflow 1/root_job] [DEBUG] 🐳 docker volume rm act-Workflow-1-root-job-eba5d9dd5bfb6267abd3e42e2cf744f3b93cfea65788590488898c0c53aff9bd-env [Workflow 1/root_job] 🏁 Job succeeded time="2024-10-10T16:46:04+01:00" level=debug msg="Saving notices etag=dd1ce151-d50d-41c3-bed5-437511234789" ``` ### Additional information In order to make this work locally I had to do a small change [here](https://github.com/nektos/act/blob/9142ed9bf7b8cf4f5c90b844c5b467ffaa54b233/pkg/runner/step_action_local.go#L54), essentially when using reusable workflows locally it would try to get the code from the docker, but whilst using localrepository or just using local actions it would try to get those from the container but of course they are not there. So I have added an extra step in there to fetch the file from local ```go else if err != nil { lreader, err := os.Open(spath) if err != nil { return nil, nil, fs.ErrNotExist } return lreader, lreader, nil } ```
kerem 2026-03-01 21:49:17 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ChristopherHX commented on GitHub (Oct 10, 2024):

It seems that at this point when the evaluator is being setup for that step to determine if it is enabled or not, the inputs are the ones from the called action which is action_2, but not from action_1

This is an dupe of https://github.com/nektos/act/issues/2426, release of 1. Nov. 2024 would ship the correction

In order to make this work locally I had to do a small change here

Sounds more like an usage error.

Local actions (not reusable workflows) are loaded from the job.
You clearly miss the actions/checkout@v4 as first step.

I removed reads from filesystem, because this is plainly wrong behavior.

--local-repository is used to map remote uses to local folders.

Sometimes are feature requests for Actions raised in act that are not compatible with GitHubs behavior, later bug reports want a revert of the behavior as it doesn't match GitHib

<!-- gh-comment-id:2405998809 --> @ChristopherHX commented on GitHub (Oct 10, 2024): > It seems that at this [point](https://github.com/nektos/act/blob/9142ed9bf7b8cf4f5c90b844c5b467ffaa54b233/pkg/runner/step.go#L264) when the evaluator is being setup for that step to determine if it is enabled or not, the inputs are the ones from the called action which is action_2, but not from action_1 This is an dupe of https://github.com/nektos/act/issues/2426, release of 1. Nov. 2024 would ship the correction > In order to make this work locally I had to do a small change [here](https://github.com/nektos/act/blob/9142ed9bf7b8cf4f5c90b844c5b467ffaa54b233/pkg/runner/step_action_local.go#L54) Sounds more like an usage error. Local actions (**not reusable workflows**) are loaded from the job. You clearly miss the actions/checkout@v4 as first step. I removed reads from filesystem, because this is plainly wrong behavior. --local-repository is used to map remote uses to local folders. _Sometimes are feature requests for Actions raised in act that are not compatible with GitHubs behavior, later bug reports want a revert of the behavior as it doesn't match GitHib_
Author
Owner

@donatobarone commented on GitHub (Oct 11, 2024):

Thanks @ChristopherHX for pointing this out https://github.com/nektos/act/issues/2426, I tried to look for a similar issue but I failed :D
About the second point, makes sense and I understand the design decision there, I guess my only point about it is that act is supposed to help with the sprawling of commits that you might end up doing to develop a github action by running it locally. Now if I have to commit every time I have a change for a re-usable workflow that I have locally that feels like less of an argument to using act, not sure if that is clear, that is why I was curious if that was intended behaviour or not.

<!-- gh-comment-id:2407326161 --> @donatobarone commented on GitHub (Oct 11, 2024): Thanks @ChristopherHX for pointing this out https://github.com/nektos/act/issues/2426, I tried to look for a similar issue but I failed :D About the second point, makes sense and I understand the design decision there, I guess my only point about it is that act is supposed to help with the sprawling of commits that you might end up doing to develop a github action by running it locally. Now if I have to commit every time I have a change for a re-usable workflow that I have locally that feels like less of an argument to using act, not sure if that is clear, that is why I was curious if that was intended behaviour or not.
Author
Owner

@ChristopherHX commented on GitHub (Oct 11, 2024):

Now if I have to commit every time I have a change for a re-usable workflow that I have locally that feels like less of an argument to using act

The answer is no.

- uses: actions/checkout@v4 is replaced by something like docker cp from your act workdir. Those it makes local actions available.

if you checkout step has some stuff in with then you are right that act will use the actual checkout action to do that.
Even then it is possible to provide your own local action that replaces - uses: actions/checkout@v4 even with a with block

Schematic, add more cli options and change paths of your local drive

act --local-repository actions/checkout@v4=/home/user/myownaction

Imagine you have a workflow that uses a reusable workflow in a job like uses: myorg/myreusablerepo/.github/workflows/test.yml@main
Then the following maps it to your local disc drive

act --local-repository myorg/myreusablerepo@main=/home/user/myreusablerepo

Warning

Reusable workflows are not beeing worked on at the moment, the current implementation in act is incomplete
Not to be confused by composite actions that use action.yml/action.yaml files, these are beeing worked on

<!-- gh-comment-id:2407392473 --> @ChristopherHX commented on GitHub (Oct 11, 2024): > Now if I have to commit every time I have a change for a re-usable workflow that I have locally that feels like less of an argument to using act The answer is no. `- uses: actions/checkout@v4` is replaced by something like docker cp from your act workdir. Those it makes local actions available. if you checkout step has some stuff in `with` then you are right that act will use the actual checkout action to do that. Even then it is possible to provide your own local action that replaces `- uses: actions/checkout@v4` even with a `with` block Schematic, add more cli options and change paths of your local drive ``` act --local-repository actions/checkout@v4=/home/user/myownaction ``` Imagine you have a workflow that uses a reusable workflow in a job like `uses: myorg/myreusablerepo/.github/workflows/test.yml@main` Then the following maps it to your local disc drive ``` act --local-repository myorg/myreusablerepo@main=/home/user/myreusablerepo ``` > [!WARNING] > Reusable workflows are not beeing worked on at the moment, the current implementation in act is incomplete > _Not to be confused by composite actions that use action.yml/action.yaml files, these are beeing worked on_
Author
Owner

@donatobarone commented on GitHub (Oct 11, 2024):

@ChristopherHX thanks a lot for taking the time to explain this further. We do indeed have with in the checkout action, but still I appreciate the time you took to explain it to me, I will resolve this for now. I have validated the latest version of master and it works, so closing this issue

<!-- gh-comment-id:2407399349 --> @donatobarone commented on GitHub (Oct 11, 2024): @ChristopherHX thanks a lot for taking the time to explain this further. We do indeed have with in the checkout action, but still I appreciate the time you took to explain it to me, I will resolve this for now. I have validated the latest version of master and it works, so closing this issue
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#1148
No description provided.