Files
act_gitea/pkg/runner/testdata/.github/workflows/local-reusable-and-dispatch.yml
S. M. Mahmudul Haque (Yamin) deea8ec8c6 fix: prevent unintended input replacement in reusable workflows with workflow_dispatch when using workflow_call (#2502)
* Remove redundant check

See: https://github.com/nektos/act/issues/2464#issuecomment-2430903650

* Add condition to prevent replacing inputs in reusable workflows with workflow_dispatch inputs

Closes: https://github.com/nektos/act/issues/2464

* fmt

* Revert "Remove redundant check"

This reverts commit 63455960ec714eea7631a586bcd59bed449739fc.

* add test

* Update runner_test.go

* update label

---------

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2024-12-29 14:52:06 +00:00

30 lines
927 B
YAML

name: reuse
on:
workflow_dispatch:
inputs:
my-val:
type: string
required: true
default: "default_value_reuse_workflow_dispatch_call"
dispatch-val:
type: string
default: "I am a dispatch var for checking if I am being used in workflow_call"
workflow_call:
inputs:
my-val:
type: string
required: true
default: "default_value_reuse_workflow_call"
jobs:
reusable_workflow_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run a one-line script
run: echo "✅ 🚀 ✅ hello this is from workflow reuse. Value - " ${{ inputs.my-val }} ${{ github.event_name }} ${{ inputs.dispatch-val }}
- name: Assert
run: |
exit ${{ ( inputs.my-val == 'default_value_reuse_workflow_call' || inputs.my-val == 'passed value from main' ) && !inputs.dispatch-val && '0' || '1' }}