Using event inputs in jobs.id.steps.uses

According to the workflow syntax it’s possible to do this:

on:
  workflow_dispatch:
    inputs:
      src_ref:
        description: Which branch to test?
        required: true
        default: master

jobs:
  my_first_job:
    steps:
      - name: My step
        uses: unfor19/install-aws-cli-action@v1 # <-- static

But if I try to use a dynamic GitHub ref in uses, I get an error

jobs:
  my_first_job:
    steps:
      - name: My step
        uses: unfor19/install-aws-cli-action@${{ github.event.inputs.src_ref }}
                                            # ^^^ Produces an error

Error:

The workflow is not valid. .github/workflows/test-action.yml (Line: 19, Col: 13): Unrecognized named-value: ‘github’. Located at position 1 within expression: github.event.inputs.src_ref

Is there any way to pass a dynamic ref to uses?

No, it cannot be dynamic:

1 Like

Thanks you @Simran-B

1 Like