diff --git a/actions/example-workflow-call/.forgejo/workflows/reusable.yml b/actions/example-workflow-call/.forgejo/workflows/reusable.yml index 87659501..aa6d029e 100644 --- a/actions/example-workflow-call/.forgejo/workflows/reusable.yml +++ b/actions/example-workflow-call/.forgejo/workflows/reusable.yml @@ -4,6 +4,9 @@ on: parameter1: required: true type: string + outputs: + output1: + value: ${{ jobs.callee.outputs.job-output }} jobs: callee: @@ -12,11 +15,16 @@ jobs: image: code.forgejo.org/oci/node:22-bookworm volumes: - /srv/example:/srv/example + outputs: + job-output: ${{ steps.stepwithoutput.outputs.myvalue }} steps: - - run: | + - id: stepwithoutput + run: | set -x test "${{ inputs.parameter1 }}" = "value1" + test "${{ secrets.secret }}" = "keep_it_private" + echo "myvalue=outputvalue1" >> $FORGEJO_OUTPUT - name: save event run: | diff --git a/actions/example-workflow-call/.forgejo/workflows/test.yml b/actions/example-workflow-call/.forgejo/workflows/test.yml index e009eeef..6185f8f7 100644 --- a/actions/example-workflow-call/.forgejo/workflows/test.yml +++ b/actions/example-workflow-call/.forgejo/workflows/test.yml @@ -9,3 +9,15 @@ jobs: uses: ./.forgejo/workflows/reusable.yml with: parameter1: value1 + secrets: + secret: keep_it_private + + verify: + needs: [caller] + runs-on: docker + container: + image: code.forgejo.org/oci/node:22-bookworm + steps: + - run: | + set -x + test "${{ needs.caller.outputs.output1 }}" = "outputvalue1"