Runner: Setting strategy.matrix to variable value returns a "invalid workflow file" error

Created on 9 Oct 2020  路  6Comments  路  Source: actions/runner

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

  1. Use the example from the Context and Expression syntax guide from the GitHub Actions docs (https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#example-6)
  2. Push up to any repo
  3. The workflow file error will come up immediately

Expected behavior
There should not be a workflow file error unless something has changed about matrix variables/syntax

Runner Version and Platform

Version of your runner? ubuntu-latest

What's not working?

An example can be found here
The error text is:
"Invalid workflow file
You have an error in your yaml syntax on line 15"

Job Log Output

No job log output as the jobs never run

Runner and Worker's Diagnostic Logs

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

bug

Most helpful comment

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!

All 6 comments

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!

Was this page helpful?
0 / 5 - 0 ratings