end-to-end/actions/example-workflow-call/.forgejo/workflows/reusable.yml
Earl Warren 44f2cf9cf1
actions: show how secrets & outputs work with workflow_call (#934)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/934
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-16 20:47:03 +00:00

35 lines
847 B
YAML

on:
workflow_call:
inputs:
parameter1:
required: true
type: string
outputs:
output1:
value: ${{ jobs.callee.outputs.job-output }}
jobs:
callee:
runs-on: docker
container:
image: code.forgejo.org/oci/node:22-bookworm
volumes:
- /srv/example:/srv/example
outputs:
job-output: ${{ steps.stepwithoutput.outputs.myvalue }}
steps:
- id: stepwithoutput
run: |
set -x
test "${{ inputs.parameter1 }}" = "value1"
test "${{ secrets.secret }}" = "keep_it_private"
echo "myvalue=outputvalue1" >> $FORGEJO_OUTPUT
- name: save event
run: |
d=/srv/example/push/contexts/$FORGEJO_EVENT_NAME
mkdir -p $d
cat > $d/github <<'EOF'
${{ toJSON(github) }}
EOF