I have a working GitHub workflow that uses a matrix and builds all defined products.
name: Build
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
product: [yellow, green, black]
limits: [10,20,50,100]
steps:
- uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
...
Now a wanted to be able to trigger the build process manually and use input values to only build the product I want. I can enter values on Github interface, but it looks the syntax of using them is not right.
Build : .github#L1 Error when evaluating 'strategy' for job 'build'. .github/workflows/build.yml (Line: 27, Col: 18): Unexpected value 'yellow',.github/workflows/build.yml (Line: 28, Col: 17): Unexpected value '50'
Also, how would one combine previous automatic builds of all predefined products with the one manually done via inputs inside one workflow?
name: Build
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
product:
description: "Product"
default: "yellow"
limit:
description: "Limit"
default: "50"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
product: ${{ github.event.inputs.product}}
limits: ${{ github.event.inputs.limit }}
# product: [yellow, green, black]
# limits: [10,20,50,100]
steps:
- uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
...