actions: add trivial needs output example (#915)

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/915
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
Earl Warren 2025-08-12 10:37:15 +00:00 committed by earl-warren
parent 15cfe2f55c
commit 20f170d4a0
No known key found for this signature in database
GPG key ID: F128CBE6AB3A7201
2 changed files with 20 additions and 1 deletions

View file

@ -143,7 +143,7 @@ function test_actions() {
done
fi
for example in echo matrix workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do
for example in echo matrix needs workflow-call lxc config-options cache checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context; do
run actions_verify_example $example
done

View file

@ -0,0 +1,19 @@
on: [push]
jobs:
job1:
runs-on: docker
outputs:
job1output: ${{ steps.step1.outputs.value }}
steps:
- id: step1
run: |
set -x
echo "value=value1" >> $FORGEJO_OUTPUT
job2:
needs: [job1]
runs-on: docker
steps:
- run: |
set -x
test "${{ needs.job1.outputs.job1output }}" = "value1"