GitHub Actions Inputs Variables Not Working

I am having issues using on.workflow_call.inputs. I tried using the example from GitHub Docs, Workflow syntax for GitHub Actions - GitHub Docs, and this also failed. The workflow is provided below:

name: "Test Inputs"

on:
  push:
  workflow_call:
    inputs:
      username:
        description: 'A username passed from the caller workflow'
        default: 'john-doe'
        required: false
        type: string
  
jobs:
  print-username:
    runs-on: ubuntu-latest

    steps:
      - name: Print the input name to STDOUT
        run: echo The username is ${{ inputs.username }}

This workflow only prints The username is when it should be The username is john-doe. I have also tried ${{ github.event.inputs.username }} and ${{ INPUT_USERNAME}}. Any help would be appreciated. Thank you!

1 Like

Can you share the code of the other workflow that calls this workflow as well, please?

I just now tested the reusable workflow. It prints The username is when it should be The username is john-doe .

name: Reuse Workflow

on:
  push:

jobs:
  reuse:
    name: Reuse
    uses: ArielSAdamsNASA/cFS-JSF-Rules/.github/workflows/workflow.yml@Rule1

I resolved my issue. I was not using ‘’ for my inputs and did not realized that the original workflow will not use the default value itself. One must call the workflow first. Thank you for your help!