Giter Club home page Giter Club logo

Comments (7)

rhysd avatar rhysd commented on June 3, 2024

The error looks correct. The PR matrix value is an array because it is generated by filter syntax (github.event.workflow_run.pull_requests.*.number). An array value can not be embedded with ${{ }} syntax directly. I think probably what you want to do is:

- run: echo '${{ toJSON(matrix.PR) }}'

from actionlint.

carlocab avatar carlocab commented on June 3, 2024

But matrix.PR is a scalar when evaluated inside the run: statement because of the way GitHub Actions handles matrix, so doing

- run: echo '${{ matrix.PR }}'

is not an error.

from actionlint.

rhysd avatar rhysd commented on June 3, 2024

But matrix.PR is a scalar when evaluated inside the run: statement

That's because the result of the filter syntax happened to be an array with a single element, am I correct? If the result contained two elements, the result would've been different.

from actionlint.

carlocab avatar carlocab commented on June 3, 2024

That's because the result of the filter syntax happened to be an array with a single element, am I correct?

No, that is not correct.

If the result contained two elements, the result would've been different.

github.event.workflow_run.pull_requests.*.number can contain any number of elements. Regardless of the number of elements this array contains, in the context of run:, matrix.PR is always a scalar (conditional on the run: statement being reached).

Please see: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs

from actionlint.

rhysd avatar rhysd commented on June 3, 2024

Oh, OK, I misread your workflow. Yes, since it is a row of matrix, the value should be scalar. Thanks for your explanation.

from actionlint.

carlocab avatar carlocab commented on June 3, 2024

Thanks, @rhysd!

from actionlint.

rhysd avatar rhysd commented on June 3, 2024

@carlocab This was a bug of actionlint. Thank you for your report with the nice reproduction.

from actionlint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.