INPUT_* environment variables are missing in composite actions
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducer files composite-action/action.yaml and .github/workflows/main.yml, then run the workflow and inspect how composite-action inputs are handled by the runner. Done means the example's steps receive INPUT_NUM1 through INPUT_NUM4 with their configured values, while the existing input context continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- ci-cd, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100