Skip to content

Bug: object dereference must be type of object but got "string" #285

@dan-ih

Description

@dan-ih

actionlint version tested : 1.6.23

Issue description:

Getting the actionlint validation failure "receiver of object dereference "refname" must be type of object but got "string"", but the workflow is showing the values as expected in github actions.

How to replicate:

Given the following (truncated) reusable workflow

workflow.yml:

name: Run test automation group
on:
  workflow_call:
    inputs:
      test_data:
        required: true
        type: string
jobs:
  run-tests:
    runs-on: ubuntu-20.04
    env:
      COMPONENT: ${{ matrix.components.TEST.COMPONENT }}
      PROFILE: ${{ matrix.components.TEST.PROFILE }}
    strategy:
      fail-fast: false
      matrix:
        components:
          - ${{ fromJson(inputs.test_data).TESTS.TEST }}
     steps:
       - ...

actionlint fails on references to elements in the matrix:

grtest.yml:16:22: receiver of object dereference "test" must be type of object but got "string" [expression]
   |
16 |       COMPONENT: ${{ matrix.components.TEST.COMPONENT }}
   |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
grtest.yml:17:20: receiver of object dereference "test" must be type of object but got "string" [expression]
   |
17 |       PROFILE: ${{ matrix.components.TEST.PROFILE }}

Structure of the 'test_data' json input:

{
    "GROUP": "Some group",
    "TESTS": [
        {
            "TEST": {
                "COMPONENT": "one_component"
            }
        },
        {
            "TEST": {
                "COMPONENT": "another_component"
            }
        }
    ]
}

Github actions is able to reference these values without issues.

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