Describe the bug
It seems that we can no longer set matrix.strategy to an output of a previous job. Trying to do so will cause the job to immediately fail with a "Invalid Workflow file" error.
To Reproduce
Expected behavior
There should not be a workflow file error unless something has changed about matrix variables/syntax
Version of your runner? ubuntu-latest
An example can be found here
The error text is:
"Invalid workflow file
You have an error in your yaml syntax on line 15"
No job log output as the jobs never run
No diagnostic logs available
For reference here is the example from the docs pasted fully:
```
name: build
on: push
jobs:
job1:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: echo "::set-output name=matrix::{\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}"
job2:
needs: job1
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.job1.outputs.matrix)}}
steps:
- run: build
The failure mode on PRs is especially awkward -- it doesn't list a failed check, but rather just ignores the checks completely (so the PR looks "green" even though some of the checks are completely ignored). :disappointed:
We are seeing the same as well
According to @cschleiden this should have been resolved. See discussion here: https://github.community/t/dynamic-matrix-yaml-syntax-error/136705/7
We would like some kind of an explanation and/or what will be done to prevent something like this again.
"Ran 28 seconds ago" -- https://github.com/docker-library/official-images/actions/runs/302561117
I don't believe this is completely fixed. :disappointed:
We've got a PR from four hours ago (https://github.com/docker-library/official-images/pull/8883) which doesn't have any Actions checks due to this (and several others, but that's the most recent). Every PR I merge there ends up emailing me with that action "failing" (which if it were parsing the YAML properly, wouldn't even be trying to run on a merge since it only triggers on PRs).
We have rolled out 2 bug fixes now, to cover both the cases in this issue (matrix: ${{ expression }}, and strategy: ${{ expression }}, and have added additional unit test coverage. Thanks for reporting this and let us know if you continue to see the issue!
Most helpful comment
We have rolled out 2 bug fixes now, to cover both the cases in this issue (
matrix: ${{ expression }}, andstrategy: ${{ expression }}, and have added additional unit test coverage. Thanks for reporting this and let us know if you continue to see the issue!