[GH-ISSUE #263] Inputs in env not parsed #181

Closed
opened 2026-03-01 21:40:58 +03:00 by kerem · 11 comments
Owner

Originally created by @kenorb on GitHub (May 30, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/263

Originally assigned to: @catthehacker on GitHub.

Steps to reproduce:

  1. On the empty folder, create new repo: git init.
  2. Create the following files:

action.yml

name: 'Test'
inputs:
  MyInput:
    description: 'My input'
runs:
  using: 'docker'
  image: 'Dockerfile'
  env:
    MYINPUT: ${{ inputs.MyInput }}

Dockerfile

FROM ubuntu
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

entrypoint.sh

#!/usr/bin/env bash

echo Input: $MYINPUT

.github/workflows/action.yml

name: Action
on: push
jobs:
  Test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: ./

Problem

The script doesn't print my input.

% act -j Test
[Action/Test]   🐳  docker run image=act-test:latest entrypoint=[] cmd=[]
| Input: ${{ inputs.MyInput }}

It prints ${{ inputs.MyInput }}, instead of the value of the variable.

Originally created by @kenorb on GitHub (May 30, 2020). Original GitHub issue: https://github.com/nektos/act/issues/263 Originally assigned to: @catthehacker on GitHub. Steps to reproduce: 1. On the empty folder, create new repo: `git init`. 2. Create the following files: ### `action.yml` ``` name: 'Test' inputs: MyInput: description: 'My input' runs: using: 'docker' image: 'Dockerfile' env: MYINPUT: ${{ inputs.MyInput }} ``` ### `Dockerfile` ``` FROM ubuntu COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] ``` ### `entrypoint.sh` ``` #!/usr/bin/env bash echo Input: $MYINPUT ``` ### `.github/workflows/action.yml` ``` name: Action on: push jobs: Test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ./ ``` ## Problem The script doesn't print my input. ``` % act -j Test [Action/Test] 🐳 docker run image=act-test:latest entrypoint=[] cmd=[] | Input: ${{ inputs.MyInput }} ``` It prints `${{ inputs.MyInput }}`, instead of the value of the variable.
Author
Owner

@github-actions[bot] commented on GitHub (Aug 3, 2020):

Issue is stale and will be closed in 7 days unless there is new activity

<!-- gh-comment-id:667744878 --> @github-actions[bot] commented on GitHub (Aug 3, 2020): Issue is stale and will be closed in 7 days unless there is new activity
Author
Owner

@kenorb commented on GitHub (Aug 3, 2020):

Issue is stale and will be closed in 7 days unless there is new activity

Still valid.

<!-- gh-comment-id:668028870 --> @kenorb commented on GitHub (Aug 3, 2020): > Issue is stale and will be closed in 7 days unless there is new activity Still valid.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 5, 2020):

Issue is stale and will be closed in 7 days unless there is new activity

<!-- gh-comment-id:703338820 --> @github-actions[bot] commented on GitHub (Oct 5, 2020): Issue is stale and will be closed in 7 days unless there is new activity
Author
Owner

@kenorb commented on GitHub (Oct 5, 2020):

Issue is stale and will be closed in 7 days unless there is new activity

Still valid.

<!-- gh-comment-id:703555544 --> @kenorb commented on GitHub (Oct 5, 2020): > Issue is stale and will be closed in 7 days unless there is new activity Still valid.
Author
Owner

@jpatrick-ztel commented on GitHub (Oct 13, 2020):

Indeed valid

<!-- gh-comment-id:707999227 --> @jpatrick-ztel commented on GitHub (Oct 13, 2020): Indeed valid
Author
Owner

@github-actions[bot] commented on GitHub (Jan 8, 2021):

Issue is stale and will be closed in 7 days unless there is new activity

<!-- gh-comment-id:756474915 --> @github-actions[bot] commented on GitHub (Jan 8, 2021): Issue is stale and will be closed in 7 days unless there is new activity
Author
Owner

@callum-tait-pbx commented on GitHub (Mar 20, 2021):

Ran into this when testing a custom action

<!-- gh-comment-id:803312062 --> @callum-tait-pbx commented on GitHub (Mar 20, 2021): Ran into this when testing a custom action
Author
Owner

@mkroman commented on GitHub (Jul 28, 2021):

I have the same issue when running ansible/ansible-lint-action@c37fb7b.

The environment variables in actions don't seem to get expanded:

| + [[ -n ${{ inputs.override-deps }} ]]
| + pip install '${{' inputs.override-deps '}}'
| ERROR: Invalid requirement: '${{'
| + echo 'Completed installing override dependencies...
<!-- gh-comment-id:887958389 --> @mkroman commented on GitHub (Jul 28, 2021): I have the same issue when running [ansible/ansible-lint-action@`c37fb7b`](https://github.com/ansible/ansible-lint-action/tree/c37fb7b4bda2c8cb18f4942716bae9f11b0dc9bc). The environment variables in actions don't seem to get expanded: ``` | + [[ -n ${{ inputs.override-deps }} ]] | + pip install '${{' inputs.override-deps '}}' | ERROR: Invalid requirement: '${{' | + echo 'Completed installing override dependencies... ```
Author
Owner

@koalalorenzo commented on GitHub (Aug 12, 2021):

Same issue here. Still valid!

<!-- gh-comment-id:897568483 --> @koalalorenzo commented on GitHub (Aug 12, 2021): Same issue here. Still valid!
Author
Owner

@Misterio77 commented on GitHub (Aug 20, 2021):

Having this as well

<!-- gh-comment-id:902368294 --> @Misterio77 commented on GitHub (Aug 20, 2021): Having this as well
Author
Owner

@kellym commented on GitHub (Nov 12, 2021):

Having same issue as @mkroman above.

<!-- gh-comment-id:967275058 --> @kellym commented on GitHub (Nov 12, 2021): Having same issue as @mkroman above.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#181
No description provided.