actions / actions/runner

Hopefully reusable workflow agrees to support ${{inputs. XXX}} expression parameter passing

Open
#1,976 12 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the enhancement
I wanted to pass the parameters of the workflow_dispatch input in a reusable workflow,
and with ${{inputs.username}} expression, the value could not be read and without an error message.

But if using ${{github.event.inputs.username}} it works fine, I don't know why.
The official documentation does not detail the difference between the two and which to use in reusable workflows

Code Snippet

name: Caller

on:
  workflow_dispatch:
    inputs:
      username:
        type: string
        description: 'username'
        required: false
        default: 'john-doe'
        
jobs:
  Test-1:
      uses: ./.github/workflows/test_1.yml
      with:
        username: ${{ inputs.username }}       #${{ github.event.inputs.username }}
      secrets: inherit
name: Executor

on:
  push:
  workflow_call:
    inputs:
      username:
        type: string
        description: 'A username passed from the caller workflow'
        default: 'john-doe'
        required: false
        
      
jobs:
  Test-1:
    runs-on: ubuntu-latest
    steps:
      - name: Print the input name to STDOUT
        run: echo The username is ${{ inputs.username }}

Additional information
Add any other context about the feature here.

NOTE: if the feature request has been agreed upon then the assignee will create an ADR. See docs/adrs/README.md

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the workflow_dispatch and workflow_call input examples in the issue, then read docs/adrs/README.md for the repository's process for agreed feature requests. Determine the expected behavior and documentation for passing inputs through a reusable workflow, and confirm the result using the shown Caller and Executor workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, github-actions
Domain
ci-cd
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.