Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dan-ih opened this issue Mar 16, 2023 · 0 comments
Closed

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

dan-ih opened this issue Mar 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@dan-ih
Copy link

dan-ih commented Mar 16, 2023

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.

@rhysd rhysd changed the title Bug: of object dereference "refname" must be type of object but got "string" Bug: of object dereference must be type of object but got "string" Jun 19, 2023
@rhysd rhysd changed the title Bug: of object dereference must be type of object but got "string" Bug: object dereference must be type of object but got "string" Jun 19, 2023
@rhysd rhysd added the bug Something isn't working label Jun 19, 2023
@rhysd rhysd closed this as completed in 47fcfea Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants