diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml index 1e806711..649392c1 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml @@ -4,6 +4,9 @@ on: input1: required: true type: string + input3: + required: true + type: string outputs: output1: value: ${{ jobs.callee-1.outputs.job-output }} @@ -28,6 +31,7 @@ jobs: run: | set -x test "top-level-input1" = "${{ inputs.input1 }}" + test "dynamic output" = "${{ inputs.input3 }}" - name: verify workflow secrets run: | set -x @@ -38,10 +42,13 @@ jobs: run: touch /srv/example/callee-1 layer-2: + needs: [callee-1] uses: ./.forgejo/workflows/reusable-layer-2.yml with: input1: ${{ inputs.input1 }} input2: mid-level-input2 + input3: ${{ inputs.input3 }} + input4: ${{ needs.callee-1.outputs.job-output }} secrets: inherit callee-2: diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml index eaf37ba1..3b633ebd 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-2.yml @@ -7,6 +7,12 @@ on: input2: required: true type: string + input3: + required: true + type: string + input4: + required: true + type: string outputs: output3: value: ${{ jobs.callee-3.outputs.job-output }} @@ -28,6 +34,8 @@ jobs: set -x test "top-level-input1" = "${{ inputs.input1 }}" test "mid-level-input2" = "${{ inputs.input2 }}" + test "dynamic output" = "${{ inputs.input3 }}" + test "callee-1-output" = "${{ inputs.input4 }}" - name: verify workflow secrets inherited run: | set -x diff --git a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml index dfa29afc..cd9290a2 100644 --- a/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call-expansion/.forgejo/workflows/test.yml @@ -2,10 +2,22 @@ on: push: jobs: + pre-job: + runs-on: docker + container: + image: data.forgejo.org/oci/node:22-bookworm + outputs: + dynamic: "${{ steps.dynamic-step.outputs.dynamic }}" + steps: + - id: dynamic-step + run: echo "dynamic=dynamic output" >> $FORGEJO_OUTPUT + layer-1: + needs: [pre-job] uses: ./.forgejo/workflows/reusable-layer-1.yml with: input1: top-level-input1 + input3: ${{ needs.pre-job.outputs.dynamic }} secrets: secret1: AAAA secret2: BBBB1234