-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
According to the documentation actions should receive their input values as environment variables prefixed with INPUT_ in addition to the inputs context. These environment variables are missing for composite actions.
To Reproduce
Steps to reproduce the behavior:
- Create a composite action with one or more inputs, and a step that outputs the associated
INPUTvariables:
inputs:
foo:
description: 'Test input'
required: yes
runs:
using: composite
steps:
- run: |
echo "FOO: ${INPUT_FOO}"
shell: bash- Use the action in a workflow:
steps:
- uses: ./example-action
with:
foo: 'bar'- Observe the lack of value after the
FOO:prefix.
I have an example action and workflow (the uses: ./composite-action step) that demonstrate the issue and the obvious workaround. There's a workflow run as well (check the "Run /./composite-action" step).
Expected behavior
Steps should be able to read inputs via environment variables, INPUT_FOO in the example above, INPUT_NUM1 (to 4) in my reproducer.
Runner Version and Platform
Version of your runner?
- 2.272.0
OS of the machine running the runner? OSX/Windows/Linux/...
- Ubuntu 20.04.1 LTS (Github hosted runner VM)
Job Log Output
From the workflow run linked above:
Run ./composite-action
with:
num1: 1
num2: 4
num3: 0
num4: 0
Show INPUT vars
INPUT_NUM1 =
INPUT_NUM2 =
INPUT_NUM3 =
INPUT_NUM4 =
Add numbers
Credit
I became aware of the issue thanks to a post on the Github community forum and tried to reproduce the issue out of curiosity.