Skip to content

Possible false possible with matrix #261

@orbegoso

Description

@orbegoso

Running actionlint version

1.6.22
installed by building from source
built with go1.19.2 compiler for darwin/arm64

Given these steps

###

build_matrix:
  strategy:
    matrix:
      buildType: ${{ fromJson(fromJson(needs.setup.outputs.params).BUILD_TYPE_LIST) }}
      isDebug:
        - ${{ contains(fromJson('["Debug", "Both"]'), inputs.buildType) }}
      isRelease:
        - ${{ contains(fromJson('["Release", "Both"]'), inputs.buildType) }}
      exclude:
        - isDebug: false
          buildType: ${{ fromJson(fromJson(needs.setup.outputs.params).BUILD_TYPE_LIST)[0] }}
        - isRelease: false
          buildType: ${{ fromJson(fromJson(needs.setup.outputs.params).BUILD_TYPE_LIST)[1] }}

Returns the following error

.github/workflows/distribute_build.yml:80:22: value "false" in "exclude" does not exist in matrix "isdebug" combinations. possible values are "${{ contains(fromJson('[\"Debug\", \"Both\"]'), inputs.buildType) }}" [matrix]
   |
80 |           - isDebug: false
   |                      ^~~~~
.github/workflows/distribute_build.yml:82:24: value "false" in "exclude" does not exist in matrix "isrelease" combinations. possible values are "${{ contains(fromJson('[\"Release\", \"Both\"]'), inputs.buildType) }}" [matrix]
   |
82 |           - isRelease: false
   |                        ^~~~~

Seems like actionlint isn't evaluating the contains function to evaluate to a boolean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions