The shop has two price lists now: prices.txt, and sale-prices.txt for the weekend sale. ./check-prices.sh <file> checks one: a monster and a whole number of gems on every line.
A matrix runs one job once for each value you list. ${{ matrix.<name> }} is that run's value:
name: Prices
on: push
jobs:
prices:
strategy:
fail-fast: false
matrix:
list: [prices.txt, sale-prices.txt]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: ./check-prices.sh ${{ matrix.list }}Save it as .github/workflows/prices.yml. GitHub runs each workflow file on its own, so a push starts two runs now. The matrix job shows up once per value, its value in brackets: prices (sale-prices.txt), each with its own result. The name after matrix. must match the key you listed, here list.
By default, when one fails, GitHub cancels the others still running. fail-fast: false lets every one finish, so you see every list that's broken.
Objectives
- Check both price lists.
- Which one is broken?