[GH-ISSUE #1591] Act is not overriding the input variable in a workflow #798

Closed
opened 2026-03-01 21:46:28 +03:00 by kerem · 1 comment
Owner

Originally created by @julianxhokaxhiu on GitHub (Jan 31, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1591

Bug report info

act version:            0.2.40
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:
        /home/dev/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.10
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.40 -X main.commit=3e23b4fbb558bc4e8bdc72d4f75e0d94e5be3bf1 -X main.date=2023-01-16T21:35:34Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         3e23b4fbb558bc4e8bdc72d4f75e0d94e5be3bf1
                vcs.time:             2023-01-16T21:35:04Z
                vcs.modified:         true
Docker Engine:
        Engine version:        20.10.23
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Arch Linux
        OS type:               linux
        OS version:            TEMPLATE_VERSION_ID
        OS arch:               x86_64
        OS kernel:             5.15.79.1-microsoft-standard-WSL2
        OS CPU:                16
        OS memory:             15702 MB
        Security options:
                name=seccomp,profile=default

Command used with act

act --input statement=github

Describe issue

Hello,

I'm trying to understand how can I override an input in a given workflow when it is already defined. Let's take this example:


.github/workflows/test.yaml

name: Test

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v3
      - uses: ./
        with:
          statement: 'world'

action.yaml

name: test action
description: 'test action example'
inputs:
  statement:
    required: false
    default: ''
outputs: {}
runs:
  using: "composite"
  steps:
    - run: ${{ github.action_path }}/example.sh
      shell: bash
      env:
        STATEMENT: ${{ inputs.statement }}

example.sh

#!/usr/bin/env bash

echo "Hello $STATEMENT"

Now if I run act on top of this I get:

$ act
Hello world

Although now I expect to be able to override the statement input var by doing so:

$ act --input statement=github
Hello github

But instead what I get is

$ act --input statement=github
Hello world

Any idea what is going on here?

No response

Workflow content

name: Test

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v3
      - uses: ./
        with:
          statement: 'world'

Relevant log output

N/A

Additional information

No response

Originally created by @julianxhokaxhiu on GitHub (Jan 31, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1591 ### Bug report info ```plain text act version: 0.2.40 GOOS: linux GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/dev/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.40 -X main.commit=3e23b4fbb558bc4e8bdc72d4f75e0d94e5be3bf1 -X main.date=2023-01-16T21:35:34Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 3e23b4fbb558bc4e8bdc72d4f75e0d94e5be3bf1 vcs.time: 2023-01-16T21:35:04Z vcs.modified: true Docker Engine: Engine version: 20.10.23 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Arch Linux OS type: linux OS version: TEMPLATE_VERSION_ID OS arch: x86_64 OS kernel: 5.15.79.1-microsoft-standard-WSL2 OS CPU: 16 OS memory: 15702 MB Security options: name=seccomp,profile=default ``` ### Command used with act ```sh act --input statement=github ``` ### Describe issue Hello, I'm trying to understand how can I override an input in a given workflow when it is already defined. Let's take this example: --- *.github/workflows/test.yaml* ```yaml name: Test jobs: test: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v3 - uses: ./ with: statement: 'world' ``` *action.yaml* ```yaml name: test action description: 'test action example' inputs: statement: required: false default: '' outputs: {} runs: using: "composite" steps: - run: ${{ github.action_path }}/example.sh shell: bash env: STATEMENT: ${{ inputs.statement }} ``` *example.sh* ```bash #!/usr/bin/env bash echo "Hello $STATEMENT" ``` --- Now if I run act on top of this I get: ```bash $ act Hello world ``` Although now I expect to be able to override the `statement` input var by doing so: ```bash $ act --input statement=github Hello github ``` But instead what I get is ```bash $ act --input statement=github Hello world ``` Any idea what is going on here? ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Test jobs: test: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v3 - uses: ./ with: statement: 'world' ``` ### Relevant log output ```sh N/A ``` ### Additional information _No response_
kerem 2026-03-01 21:46:28 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@julianxhokaxhiu commented on GitHub (Feb 1, 2023):

My bad, after looking at #1542 I found out the syntax to use, so it looks like it's just an undocumented feature?

This is the correct workflow to be used:

name: Test

on:
  workflow_dispatch:
    inputs:
      statement:
        default: 'world'
        required: false
        type: string

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v3
      - uses: ./
        with:
          statement: ${{ inputs.statement }}

And calling the solution like this now returns the expected statement :)

$ act --input statement=github
Hello github

Cheers!

<!-- gh-comment-id:1411860008 --> @julianxhokaxhiu commented on GitHub (Feb 1, 2023): My bad, after looking at #1542 I found out the syntax to use, so it looks like it's just an undocumented feature? This is the correct workflow to be used: ```yaml name: Test on: workflow_dispatch: inputs: statement: default: 'world' required: false type: string jobs: test: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v3 - uses: ./ with: statement: ${{ inputs.statement }} ``` And calling the solution like this now returns the expected statement :) ```bash $ act --input statement=github Hello github ``` Cheers!
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#798
No description provided.