Reusable workflow input for docker:// image tag not working

37 Views Asked by At

I want to trigger a GitHub Actions reusable workflow from another workflow, I want to trigger a job three times, each for these vars ["stable", "beta", "dev"]

These three values should be the input of the reusable workflow and use this as a tag like uses: docker://homeassistant/home-assistant:${{ inputs.version }}

So this is the starter workflow:

---
name: Starter

on:
  push:
  pull_request:

jobs:
  check:
    strategy:
      matrix:
        version: ["stable", "beta", "dev"]
    steps:
      - uses: theautomation/github-actions/.github/workflows/check.yaml@main
        with:
          version: "${{ matrix.version }}"

The reusable workflow:

---
name: Reusable workflow

on:
  workflow_call:
    inputs:
      version:
        description: "The version"
        required: false
        type: string

jobs:
  check:
    name: "Check"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@main

      - name: Check
        uses: docker://homeassistant/home-assistant:${{ inputs.version }}
        with:
          args: hass --script check_config --config ./src/config

With this am getting this error:

Unrecognized named-value: 'inputs'. Located at position 1 within expression: inputs.version

How to loop over multiple versions and use this as the tag version in the uses: section uses: docker://homeassistant/home-assistant:${{ inputs.version }}?

0

There are 0 best solutions below