GitHub Actions YaML string comparison
YaML is used by GitHub Actions workflow expressions. The “if” conditional logic for a task uses comparison operators that also work to compare strings, especially useful for version numbers. The relevant portion of an example CI workflow follows:
jobs:
matlab:
strategy:
matrix:
release: [R2022a, R2022b, R2023a]
steps:
- name: Run Matlab tests (buildtool)
if: ${{ matrix.release >= 'R2022b' }}
uses: matlab-actions/run-build