mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-23 15:25:03 +01:00
fix: use the happy path for workflow_call (#88)
* not really supported mode
This commit is contained in:
@@ -514,24 +514,6 @@ func getEvaluatorInputs(ctx context.Context, rc *RunContext, step step, ghc *mod
|
||||
}
|
||||
}
|
||||
|
||||
if ghc.EventName == "workflow_call" {
|
||||
config := rc.Run.Workflow.WorkflowCallConfig()
|
||||
if config != nil && config.Inputs != nil {
|
||||
for k, v := range config.Inputs {
|
||||
value := nestedMapLookup(ghc.Event, "inputs", k)
|
||||
if value == nil {
|
||||
if err := v.Default.Decode(&value); err != nil {
|
||||
common.Logger(ctx).Debugf("error decoding default value for %s: %v", k, err)
|
||||
}
|
||||
}
|
||||
if v.Type == "boolean" {
|
||||
inputs[k] = value == "true"
|
||||
} else {
|
||||
inputs[k] = value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return inputs
|
||||
}
|
||||
|
||||
|
||||
@@ -303,7 +303,6 @@ func TestRunEvent(t *testing.T) {
|
||||
{workdir, "docker-action-custom-path", "push", "", platforms, secrets},
|
||||
{workdir, "GITHUB_ENV-use-in-env-ctx", "push", "", platforms, secrets},
|
||||
{workdir, "ensure-post-steps", "push", "Job 'second-post-step-should-fail' failed", platforms, secrets},
|
||||
{workdir, "workflow_call_inputs", "workflow_call", "", platforms, secrets},
|
||||
{workdir, "workflow_dispatch", "workflow_dispatch", "", platforms, secrets},
|
||||
{workdir, "workflow_dispatch_no_inputs_mapping", "workflow_dispatch", "", platforms, secrets},
|
||||
{workdir, "workflow_dispatch-scalar", "workflow_dispatch", "", platforms, secrets},
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"inputs": {
|
||||
"required": "required input",
|
||||
"boolean": "true"
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,10 @@ on:
|
||||
description: an input with default
|
||||
required: false
|
||||
default: default
|
||||
with_default2:
|
||||
description: an input with default
|
||||
required: false
|
||||
default: ${{ github.event_name }}
|
||||
boolean:
|
||||
description: an input of type boolean
|
||||
required: false
|
||||
@@ -27,6 +31,10 @@ jobs:
|
||||
run: |
|
||||
echo input.with_default=${{ inputs.with_default }}
|
||||
[[ "${{ inputs.with_default }}" = "default" ]] || exit 1
|
||||
- name: test input with default2
|
||||
run: |
|
||||
echo input.with_default2=${{ inputs.with_default2 }}
|
||||
[[ "${{ inputs.with_default2 }}" = "workflow_call" ]] || exit 1
|
||||
- id: boolean-test
|
||||
name: run on boolean input
|
||||
if: ${{ inputs.boolean == true }}
|
||||
|
||||
Reference in New Issue
Block a user