act/pkg/runner/testdata/uses-composite-with-inputs/push.yml
Markus Wolf 679cac1677
Fix composite input handling (#1345)
* test: add test case for #1319

* fix: setup of composite inputs

This change fixes the composite action setup handling of inputs.

All inputs are taken from the env now. The env is composed of
the 'level above'.
For example:
- step env -> taken from run context
- action env -> taken from step env
- composite env -> taken from action env

Before this change the env setup for steps, actions and composite
run contexts was harder to understand as all parts looked into
one of these: parent run context, step, action, composite run context.

Now the 'data flow' is from higher levels to lower levels which should
make it more clean.

Fixes #1319

* test: add simple remote composite action test

Since we don't have a remote composite test at all
before this, we need at least the simplest case.
This does not check every feature, but ensures basic
availability of remote composite actions.

* refactor: move ActionRef and ActionRepository

Moving ActionRef and ActionRepository from RunContext into the
step, allows us to remove the - more or less - ugly copy operations
from the RunContext.

This is more clean, as each step does hold the data required anyway
and the RunContext shouldn't know about the action details.

* refactor: remove unused properties
2022-10-06 21:58:16 +00:00

30 lines
814 B
YAML

name: push
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: use simple composite action
uses: ./uses-composite-with-inputs/action
with:
some: value
- name: use nested composite action
uses: ./uses-composite-with-inputs/composite
with:
composite-input: value
###
#
# Remote composite test
#
- name: use remote composite action
id: remote-composite
uses: nektos/act-test-actions/composite@main
with:
input: value
- name: test remote composite output
run: |
echo "steps.remote-composite.outputs.output=${{ steps.remote-composite.outputs.output }}"
[[ "${{ steps.remote-composite.outputs.output == 'value' }}" = "true" ]] || exit 1
#
###