From 20f170d4a01e65f9cfc51e365ffd2d680f2908e5 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 12 Aug 2025 10:37:15 +0000 Subject: [PATCH] actions: add trivial needs output example (#915) Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/915 Reviewed-by: Gusted Co-authored-by: Earl Warren Co-committed-by: Earl Warren --- actions/actions.sh | 2 +- .../example-needs/.forgejo/workflows/test.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 actions/example-needs/.forgejo/workflows/test.yml diff --git a/actions/actions.sh b/actions/actions.sh index ac3f5381..5df95569 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -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 diff --git a/actions/example-needs/.forgejo/workflows/test.yml b/actions/example-needs/.forgejo/workflows/test.yml new file mode 100644 index 00000000..d38a1e75 --- /dev/null +++ b/actions/example-needs/.forgejo/workflows/test.yml @@ -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"