[GH-ISSUE #2464] Reusable workflow uses workflow_dispatch default instead of passed input value #1136

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

Originally created by @Wenzel on GitHub (Sep 18, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2464

Bug report info

act version:            0.2.67
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/wenzel/.config/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.21.13
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.67 -X main.commit=f75a2d8b38cc3b929ab652c0994d6d33f6584ed9 -X main.date=2024-09-10T18:17:24Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         f75a2d8b38cc3b929ab652c0994d6d33f6584ed9
		vcs.time:             2024-09-10T18:17:07Z
		vcs.modified:         false
Docker Engine:
	Engine version:        25.0.2
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 23.10
	OS type:               linux
	OS version:            23.10
	OS arch:               x86_64
	OS kernel:             6.5.0-44-generic
	OS CPU:                16
	OS memory:             15609 MB
	Security options:
		name=apparmor
		name=seccomp,profile=builtin
		name=cgroupns

Command used with act

act workflow_dispatch -W .github/workflows/main.yml -P self-hosted=-self-hosted -v

Describe issue

When using a reusable workflow that defines the same input parameter in both its workflow_call and workflow_dispatch events, the workflow incorrectly uses the default value from the workflow_dispatch event instead of the value passed from the calling workflow.
Steps to reproduce:

  • Create a main workflow that calls a reusable workflow, passing a specific value for an input parameter.
  • In the reusable workflow, define the same input parameter in both workflow_call and workflow_dispatch events, with different default values.
  • Run the main workflow.

See the Dockerfile for repro

No response

Workflow content

name: Main Workflow
on:
  workflow_dispatch:
    inputs:
      passed_input:
        type: string
        required: true
        default: "default_value_dispatch"
jobs:
  call_reusable:
    uses: ./.github/workflows/reusable.yml
    with:
      passed_input: "Hello World"



name: Reusable Workflow
on:
  workflow_dispatch:
    inputs:
      passed_input:
        type: string
        required: true
        default: "default_value_dispatch"
  workflow_call:
    inputs:
      passed_input:
        type: string
        required: true
        default: "default_value_call"
jobs:
  reusable_job:
    runs-on: self-hosted
    steps:
        # should be "Hello World" !
        # but we get the default value of workflow_dispatch instead !
      - name: Display passed input
        run: |
          echo "input.passed_input: ${{ inputs.passed_input }}"

Relevant log output

DEBU[0000] Handling container host and socket           
DEBU[0000] Defaulting container socket to default ''    
WARN[0000] Couldn't get a valid docker connection: no DOCKER_HOST and an invalid container socket '' 
DEBU[0000] Loading environment from /repo/.env          
DEBU[0000] Loading action inputs from /repo/.input      
DEBU[0000] Loading secrets from /repo/.secrets          
DEBU[0000] Loading vars from /repo/.vars                
DEBU[0000] Evaluated matrix inclusions: map[]           
DEBU[0000] Loading workflow '/repo/.github/workflows/main.yml' 
DEBU[0000] Reading workflow '/repo/.github/workflows/main.yml' 
DEBU[0000] Unable to load etag from /root/.cache/act/.notices.etag: &{%!e(string=open) %!e(string=/root/.cache/act/.notices.etag) %!e(syscall.Errno=2)} 
DEBU[0000] Using first passed in arguments event for filtering: workflow_dispatch 
DEBU[0000] Preparing plan for a event: workflow_dispatch 
DEBU[0000] Using first passed in arguments event: workflow_dispatch 
DEBU[0000] Planning jobs for event: workflow_dispatch   
DEBU[0000] gc: 2024-09-18 14:28:12.353815707 +0000 UTC m=+0.041078425  module=artifactcache
DEBU[0000] Plan Stages: [0xc0004418a8]                  
DEBU[0000] Stages Runs: [call_reusable]                 
DEBU[0000] Job.Name: call_reusable                      
DEBU[0000] Job.RawNeeds: {0 0    <nil> []    0 0}       
DEBU[0000] Job.RawRunsOn: {0 0    <nil> []    0 0}      
DEBU[0000] Job.Env: {0 0    <nil> []    0 0}            
DEBU[0000] Job.If: {0 0  success()  <nil> []    0 0}    
DEBU[0000] Job.TimeoutMinutes:                          
DEBU[0000] Job.Services: map[]                          
DEBU[0000] Job.Strategy: <nil>                          
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: ./.github/workflows/reusable.yml   
DEBU[0000] Job.With: map[passed_input:Hello World]      
DEBU[0000] Job.Result:                                  
DEBU[0000] Empty Strategy, matrixes=[map[]]             
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: /repo): remote not found 
DEBU[0000] Loading revision from git directory          
DEBU[0000] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 
DEBU[0000] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' 
DEBU[0000] using github ref: refs/heads/master          
DEBU[0000] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 
DEBU[0000] Detected CPUs: 16                            
[Main Workflow/call_reusable] [DEBUG] evaluating expression 'success()'
[Main Workflow/call_reusable] [DEBUG] expression 'success()' evaluated to 'true'
DEBU[0000] Loading workflow '/repo/.github/workflows/reusable.yml' 
DEBU[0000] Reading workflow '/repo/.github/workflows/reusable.yml' 
DEBU[0000] Plan Stages: [0xc0004406a8]                  
DEBU[0000] Stages Runs: [reusable_job]                  
DEBU[0000] Job.Name: reusable_job                       
DEBU[0000] Job.RawNeeds: {0 0    <nil> []    0 0}       
DEBU[0000] Job.RawRunsOn: {8 0 !!str self-hosted  <nil> []    17 14} 
DEBU[0000] Job.Env: {0 0    <nil> []    0 0}            
DEBU[0000] Job.If: {0 0  success()  <nil> []    0 0}    
DEBU[0000] Job.Steps: Display passed input              
DEBU[0000] Job.TimeoutMinutes:                          
DEBU[0000] Job.Services: map[]                          
DEBU[0000] Job.Strategy: <nil>                          
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] Empty Strategy, matrixes=[map[]]             
DEBU[0000] Job Matrices: [map[]]                        
DEBU[0000] Runner Matrices: map[]                       
DEBU[0000] Final matrix after applying user inclusions '[map[]]' 
[Main Workflow/call_reusable] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[Main Workflow/call_reusable] [DEBUG] Loading revision from git directory
[Main Workflow/call_reusable] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[Main Workflow/call_reusable] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[Main Workflow/call_reusable] [DEBUG] using github ref: refs/heads/master
[Main Workflow/call_reusable] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
DEBU[0000] Detected CPUs: 16                            
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] evaluating expression 'success()'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression 'success()' evaluated to 'true'
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.17.0.2:37609/ 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:workflow_dispatch GITHUB_EVENT_PATH:/root/.cache/act/c228450c6703b3f9/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:reusable_job GITHUB_REF:refs/heads/master GITHUB_REF_NAME:master GITHUB_REF_TYPE:branch GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:f783bc5c5d17fe15daaaa9daf28910aa93f982b5 GITHUB_WORKFLOW:Reusable Workflow GITHUB_WORKSPACE:/root/.cache/act/c228450c6703b3f9/hostexecutor HOME:/root HOSTNAME:6393f7ac73d7 ImageOS:selfhosted PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD:/repo RUNNER_ARCH:amd64 RUNNER_OS:Linux RUNNER_PERFLOG:/dev/null RUNNER_TEMP:/root/.cache/act/c228450c6703b3f9/tmp RUNNER_TOOL_CACHE:/root/.cache/act/tool_cache RUNNER_TRACKING_ID: TERM:xterm]
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] evaluating expression ''
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression '' evaluated to 'true'
[call_reusable/Reusable Workflow/reusable_job] ⭐ Run Main Display passed input
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression 'echo "input.passed_input: ${{ inputs.passed_input }}"
' rewritten to 'format('echo "input.passed_input: {0}"
', inputs.passed_input)'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] evaluating expression 'format('echo "input.passed_input: {0}"
', inputs.passed_input)'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression 'format('echo "input.passed_input: {0}"
', inputs.passed_input)' evaluated to '%!t(string=echo "input.passed_input: default_value_dispatch"
)'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Wrote command 

echo "input.passed_input: default_value_dispatch"


 to 'workflow/0.sh'
| input.passed_input: default_value_dispatch
[call_reusable/Reusable Workflow/reusable_job]   ✅  Success - Main Display passed input
[call_reusable/Reusable Workflow/reusable_job] Cleaning up container for job reusable_job
[call_reusable/Reusable Workflow/reusable_job] 🏁  Job succeeded
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5'
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master
[call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5
DEBU[0000] Saving notices etag=7dcbfdd4-8c6c-4c4a-a697-e7a76a894f72

Additional information

Dockerfile to repro the issue easily:

FROM ubuntu:20.04

RUN apt-get update && apt-get install -y curl git && \
    curl https://raw.githubusercontent.com/nektos/act/master/install.sh | bash && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /repo

# Initialize git repo
RUN git init

# Create .github/workflows directory
RUN mkdir -p .github/workflows

# Create main workflow
COPY <<EOF .github/workflows/main.yml
name: Main Workflow
on:
  workflow_dispatch:
    inputs:
      passed_input:
        type: string
        required: true
        default: "default_value_dispatch"
jobs:
  call_reusable:
    uses: ./.github/workflows/reusable.yml
    with:
      passed_input: "Hello World"
EOF

# Create reusable workflow with conditional test
COPY <<EOF .github/workflows/reusable.yml
name: Reusable Workflow
on:
  workflow_dispatch:
    inputs:
      passed_input:
        type: string
        required: true
        default: "default_value_dispatch"
  workflow_call:
    inputs:
      passed_input:
        type: string
        required: true
        default: "default_value_call"
jobs:
  reusable_job:
    runs-on: self-hosted
    steps:
        # should be "Hello World" !
        # but we get the default value of workflow_dispatch instead !
      - name: Display passed input
        run: |
          echo "input.passed_input: \${{ inputs.passed_input }}"
EOF

# Add and commit the workflows
RUN git add . && git config --global user.email "you@example.com" && \
    git config --global user.name "Your Name" && \
    git commit -m "Add workflows"

CMD act workflow_dispatch -W .github/workflows/main.yml -P self-hosted=-self-hosted -v
Originally created by @Wenzel on GitHub (Sep 18, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2464 ### Bug report info ```plain text act version: 0.2.67 GOOS: linux GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /home/wenzel/.config/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.21.13 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -s -w -X main.version=0.2.67 -X main.commit=f75a2d8b38cc3b929ab652c0994d6d33f6584ed9 -X main.date=2024-09-10T18:17:24Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: f75a2d8b38cc3b929ab652c0994d6d33f6584ed9 vcs.time: 2024-09-10T18:17:07Z vcs.modified: false Docker Engine: Engine version: 25.0.2 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 23.10 OS type: linux OS version: 23.10 OS arch: x86_64 OS kernel: 6.5.0-44-generic OS CPU: 16 OS memory: 15609 MB Security options: name=apparmor name=seccomp,profile=builtin name=cgroupns ``` ### Command used with act ```sh act workflow_dispatch -W .github/workflows/main.yml -P self-hosted=-self-hosted -v ``` ### Describe issue When using a reusable workflow that defines the same input parameter in both its workflow_call and workflow_dispatch events, the workflow incorrectly uses the default value from the workflow_dispatch event instead of the value passed from the calling workflow. Steps to reproduce: - Create a main workflow that calls a reusable workflow, passing a specific value for an input parameter. - In the reusable workflow, define the same input parameter in both workflow_call and workflow_dispatch events, with different default values. - Run the main workflow. See the Dockerfile for repro ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Main Workflow on: workflow_dispatch: inputs: passed_input: type: string required: true default: "default_value_dispatch" jobs: call_reusable: uses: ./.github/workflows/reusable.yml with: passed_input: "Hello World" name: Reusable Workflow on: workflow_dispatch: inputs: passed_input: type: string required: true default: "default_value_dispatch" workflow_call: inputs: passed_input: type: string required: true default: "default_value_call" jobs: reusable_job: runs-on: self-hosted steps: # should be "Hello World" ! # but we get the default value of workflow_dispatch instead ! - name: Display passed input run: | echo "input.passed_input: ${{ inputs.passed_input }}" ``` ### Relevant log output ```sh DEBU[0000] Handling container host and socket DEBU[0000] Defaulting container socket to default '' WARN[0000] Couldn't get a valid docker connection: no DOCKER_HOST and an invalid container socket '' DEBU[0000] Loading environment from /repo/.env DEBU[0000] Loading action inputs from /repo/.input DEBU[0000] Loading secrets from /repo/.secrets DEBU[0000] Loading vars from /repo/.vars DEBU[0000] Evaluated matrix inclusions: map[] DEBU[0000] Loading workflow '/repo/.github/workflows/main.yml' DEBU[0000] Reading workflow '/repo/.github/workflows/main.yml' DEBU[0000] Unable to load etag from /root/.cache/act/.notices.etag: &{%!e(string=open) %!e(string=/root/.cache/act/.notices.etag) %!e(syscall.Errno=2)} DEBU[0000] Using first passed in arguments event for filtering: workflow_dispatch DEBU[0000] Preparing plan for a event: workflow_dispatch DEBU[0000] Using first passed in arguments event: workflow_dispatch DEBU[0000] Planning jobs for event: workflow_dispatch DEBU[0000] gc: 2024-09-18 14:28:12.353815707 +0000 UTC m=+0.041078425 module=artifactcache DEBU[0000] Plan Stages: [0xc0004418a8] DEBU[0000] Stages Runs: [call_reusable] DEBU[0000] Job.Name: call_reusable DEBU[0000] Job.RawNeeds: {0 0 <nil> [] 0 0} DEBU[0000] Job.RawRunsOn: {0 0 <nil> [] 0 0} DEBU[0000] Job.Env: {0 0 <nil> [] 0 0} DEBU[0000] Job.If: {0 0 success() <nil> [] 0 0} DEBU[0000] Job.TimeoutMinutes: DEBU[0000] Job.Services: map[] DEBU[0000] Job.Strategy: <nil> 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: ./.github/workflows/reusable.yml DEBU[0000] Job.With: map[passed_input:Hello World] DEBU[0000] Job.Result: DEBU[0000] Empty Strategy, matrixes=[map[]] 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: /repo): remote not found DEBU[0000] Loading revision from git directory DEBU[0000] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 DEBU[0000] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' DEBU[0000] using github ref: refs/heads/master DEBU[0000] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 DEBU[0000] Detected CPUs: 16 [Main Workflow/call_reusable] [DEBUG] evaluating expression 'success()' [Main Workflow/call_reusable] [DEBUG] expression 'success()' evaluated to 'true' DEBU[0000] Loading workflow '/repo/.github/workflows/reusable.yml' DEBU[0000] Reading workflow '/repo/.github/workflows/reusable.yml' DEBU[0000] Plan Stages: [0xc0004406a8] DEBU[0000] Stages Runs: [reusable_job] DEBU[0000] Job.Name: reusable_job DEBU[0000] Job.RawNeeds: {0 0 <nil> [] 0 0} DEBU[0000] Job.RawRunsOn: {8 0 !!str self-hosted <nil> [] 17 14} DEBU[0000] Job.Env: {0 0 <nil> [] 0 0} DEBU[0000] Job.If: {0 0 success() <nil> [] 0 0} DEBU[0000] Job.Steps: Display passed input DEBU[0000] Job.TimeoutMinutes: DEBU[0000] Job.Services: map[] DEBU[0000] Job.Strategy: <nil> 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] Empty Strategy, matrixes=[map[]] DEBU[0000] Job Matrices: [map[]] DEBU[0000] Runner Matrices: map[] DEBU[0000] Final matrix after applying user inclusions '[map[]]' [Main Workflow/call_reusable] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [Main Workflow/call_reusable] [DEBUG] Loading revision from git directory [Main Workflow/call_reusable] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [Main Workflow/call_reusable] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [Main Workflow/call_reusable] [DEBUG] using github ref: refs/heads/master [Main Workflow/call_reusable] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 DEBU[0000] Detected CPUs: 16 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] evaluating expression 'success()' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression 'success()' evaluated to 'true' [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] setupEnv => map[ACT:true ACTIONS_CACHE_URL:http://172.17.0.2:37609/ 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:workflow_dispatch GITHUB_EVENT_PATH:/root/.cache/act/c228450c6703b3f9/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:reusable_job GITHUB_REF:refs/heads/master GITHUB_REF_NAME:master GITHUB_REF_TYPE:branch GITHUB_REPOSITORY: GITHUB_REPOSITORY_OWNER: GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:f783bc5c5d17fe15daaaa9daf28910aa93f982b5 GITHUB_WORKFLOW:Reusable Workflow GITHUB_WORKSPACE:/root/.cache/act/c228450c6703b3f9/hostexecutor HOME:/root HOSTNAME:6393f7ac73d7 ImageOS:selfhosted PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD:/repo RUNNER_ARCH:amd64 RUNNER_OS:Linux RUNNER_PERFLOG:/dev/null RUNNER_TEMP:/root/.cache/act/c228450c6703b3f9/tmp RUNNER_TOOL_CACHE:/root/.cache/act/tool_cache RUNNER_TRACKING_ID: TERM:xterm] [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] evaluating expression '' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression '' evaluated to 'true' [call_reusable/Reusable Workflow/reusable_job] ⭐ Run Main Display passed input [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression 'echo "input.passed_input: ${{ inputs.passed_input }}" ' rewritten to 'format('echo "input.passed_input: {0}" ', inputs.passed_input)' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] evaluating expression 'format('echo "input.passed_input: {0}" ', inputs.passed_input)' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] expression 'format('echo "input.passed_input: {0}" ', inputs.passed_input)' evaluated to '%!t(string=echo "input.passed_input: default_value_dispatch" )' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Wrote command echo "input.passed_input: default_value_dispatch" to 'workflow/0.sh' | input.passed_input: default_value_dispatch [call_reusable/Reusable Workflow/reusable_job] ✅ Success - Main Display passed input [call_reusable/Reusable Workflow/reusable_job] Cleaning up container for job reusable_job [call_reusable/Reusable Workflow/reusable_job] 🏁 Job succeeded [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: /repo): remote not found [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Loading revision from git directory [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 [call_reusable/Reusable Workflow/reusable_job] [DEBUG] HEAD points to 'f783bc5c5d17fe15daaaa9daf28910aa93f982b5' [call_reusable/Reusable Workflow/reusable_job] [DEBUG] using github ref: refs/heads/master [call_reusable/Reusable Workflow/reusable_job] [DEBUG] Found revision: f783bc5c5d17fe15daaaa9daf28910aa93f982b5 DEBU[0000] Saving notices etag=7dcbfdd4-8c6c-4c4a-a697-e7a76a894f72 ``` ### Additional information Dockerfile to repro the issue easily: ```dockerfile FROM ubuntu:20.04 RUN apt-get update && apt-get install -y curl git && \ curl https://raw.githubusercontent.com/nektos/act/master/install.sh | bash && \ apt-get clean && rm -rf /var/lib/apt/lists/* WORKDIR /repo # Initialize git repo RUN git init # Create .github/workflows directory RUN mkdir -p .github/workflows # Create main workflow COPY <<EOF .github/workflows/main.yml name: Main Workflow on: workflow_dispatch: inputs: passed_input: type: string required: true default: "default_value_dispatch" jobs: call_reusable: uses: ./.github/workflows/reusable.yml with: passed_input: "Hello World" EOF # Create reusable workflow with conditional test COPY <<EOF .github/workflows/reusable.yml name: Reusable Workflow on: workflow_dispatch: inputs: passed_input: type: string required: true default: "default_value_dispatch" workflow_call: inputs: passed_input: type: string required: true default: "default_value_call" jobs: reusable_job: runs-on: self-hosted steps: # should be "Hello World" ! # but we get the default value of workflow_dispatch instead ! - name: Display passed input run: | echo "input.passed_input: \${{ inputs.passed_input }}" EOF # Add and commit the workflows RUN git add . && git config --global user.email "you@example.com" && \ git config --global user.name "Your Name" && \ git commit -m "Add workflows" CMD act workflow_dispatch -W .github/workflows/main.yml -P self-hosted=-self-hosted -v ```
kerem 2026-03-01 21:49:11 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

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

Do you have already a plan when or how this could be tackled?

<!-- gh-comment-id:2406960785 --> @blackhatcrazy commented on GitHub (Oct 11, 2024): Do you have already a plan when or how this could be tackled?
Author
Owner

@mahmud2011 commented on GitHub (Oct 22, 2024):

Hello, if the issue is not taken then I am interested to contribute. I would greatly appreciate any guidance or direction from a regular contributor to help me get started effectively.

<!-- gh-comment-id:2428763794 --> @mahmud2011 commented on GitHub (Oct 22, 2024): Hello, if the issue is not taken then I am interested to contribute. I would greatly appreciate any guidance or direction from a regular contributor to help me get started effectively.
Author
Owner

@mahmud2011 commented on GitHub (Oct 22, 2024):

github.com/nektos/act@03a4480cd0/pkg/runner/reusable_workflow.go (L116-L144)

From initial investigation I found out, for reusable workflow PlanEvent is being called with workflow_call but NewReusableWorkflowRunner is being initialized using the passed down rc with workflow_dispatch.

Before initializing the ReusableWorkflowRunner the rc -> config -> EventName needs to be overwritten with workflow_call.

This fix still doesn't resolve the issue. Now the event is correct workflow_call but the values are incorrect as it's using the default values of workflow_call.

I am still figuring out where the values from main workflow is passed to the reuse workflow.

<!-- gh-comment-id:2429632654 --> @mahmud2011 commented on GitHub (Oct 22, 2024): https://github.com/nektos/act/blob/03a4480cd024910c88c8946da8d589b9ef0c6660/pkg/runner/reusable_workflow.go#L116-L144 From initial investigation I found out, for reusable workflow `PlanEvent` is being called with `workflow_call` but `NewReusableWorkflowRunner` is being initialized using the passed down `rc` with `workflow_dispatch`. Before initializing the `ReusableWorkflowRunner` the `rc` -> `config` -> `EventName` needs to be overwritten with `workflow_call`. This fix still doesn't resolve the issue. Now the event is correct `workflow_call` but the values are incorrect as it's using the default values of `workflow_call`. I am still figuring out where the values from main workflow is passed to the reuse workflow.
Author
Owner

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

Yes you can take this issue, this doesn't fit into my capacity for act to work on this year

Now the event is correct workflow_call

workflow_call is not an event that ever appears in github.event_name

workflow_dispatch is correct in reusable workflows triggered by a workflow that used event workflow_dispatch.

Reusable workflows in act are unfinished and unmaintained, after those working on them left

I am still figuring out where the values from main workflow is passed to the reuse workflow

Yes this is confusing, especially if someone uses the act workflow_call to bypass some logic as well.

I assume act push works? if your parent workflow uses anything different from workflow_dispatch.

<!-- gh-comment-id:2430903650 --> @ChristopherHX commented on GitHub (Oct 23, 2024): Yes you can take this issue, this doesn't fit into my capacity for act to work on this year > Now the event is correct `workflow_call` `workflow_call` is not an event that ever appears in `github.event_name` `workflow_dispatch` is correct in reusable workflows triggered by a workflow that used event `workflow_dispatch`. _Reusable workflows in act are unfinished and unmaintained, after those working on them left_ > I am still figuring out where the values from main workflow is passed to the reuse workflow Yes this is confusing, especially if someone uses the `act workflow_call` to bypass some logic as well. I assume `act push` works? if your parent workflow uses anything different from `workflow_dispatch`.
Author
Owner

@inkarkat commented on GitHub (Dec 19, 2024):

I assume act push works? if your parent workflow uses anything different from workflow_dispatch.

That's a proper workaround for me; glad I found this! I was struggling to understand why my local runs suddenly started failing once I had extracted a common resuable workflow...


In my case, the main workflows directly define inputs for the reusable workflow which is triggered on both workflow_dispatch and workflow_call events (to run the workflow itself as a demo and self-test, but mainly to be triggered by other projects). Like in OP's case, the passed inputs are ignored and instead the defaults from workflow_dispatch are used, causing the workflow to fail.

<!-- gh-comment-id:2553838846 --> @inkarkat commented on GitHub (Dec 19, 2024): > I assume act push works? if your parent workflow uses anything different from workflow_dispatch. That's a proper workaround for me; glad I found this! I was struggling to understand why my local runs suddenly started failing once I had extracted a common resuable workflow... --- In my case, the main workflows [directly](https://github.com/inkarkat/todo.txt-cli-ex/blob/8fad3beea55e58b7308d948e8d7fe6f160515ea4/.github/workflows/build.yml?plain=1#L14-L17) [define](https://github.com/inkarkat/reldate/blob/658b170455f98f28fce71e2040cd4811a88a164b/.github/workflows/build.yml?plain=1#L14-L17) inputs for the reusable workflow which is triggered on both [workflow_dispatch and workflow_call](https://github.com/inkarkat/scripting-setup/blob/82093e00230073ade4982085f67439a99b0210a6/.github/workflows/build.yml?plain=1#L13-L68) events (to run the workflow itself as a demo and self-test, but mainly to be triggered by other projects). Like in OP's case, the passed inputs are ignored and instead the defaults from `workflow_dispatch` are used, causing the workflow to fail.
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#1136
No description provided.