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

Input difference between workflow_dispatch and workflow_call produces an error "is not defined in object type" #263

Closed
kudos3939 opened this issue Jan 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kudos3939
Copy link

Hi,
Below codes produce an actionlint error which I don't expect to get.
The error says that property "second-string" is not defined in object type {first-string: string} but these workflows work fine without fixing "the error".

I think this error should not be appeared in this case.
Is there any way avoiding this?
Or if it is a bug can you fix this?

# example.yml
on:
  workflow_dispatch:
    inputs:
      first-string:
        description: some string
        type: string
  workflow_call:
    inputs:
      first-string:
        description: some string
        type: string
      second-string:
        description: string used only by workflow_call
        type: string
jobs:
  some-job:
    runs-on: ubuntu-latest

    steps:
      - run: echo '${{ inputs.first-string }}'
      - run: echo '${{ inputs.second-string }}'
# example2.yml
on:
  workflow_dispatch:
jobs:
  some-job:
    uses: ./.github/workflows/actionlint-issue-example.yml
    with:
      first-string: "AAA"
      second-string: "BBB"
$ cat .github/workflows/example.yml | docker run --rm -i rhysd/actionlint:latest -color -
<stdin>:21:24: property "second-string" is not defined in object type {first-string: string} [expression]
   |
21 |       - run: echo '${{ inputs.second-string }}'
   |                        ^~~~~~~~~~~~~~~~~~~~
$ docker run --rm rhysd/actionlint:latest -version
1.6.23
installed by building from source
built with go1.19.5 compiler for linux/amd64
@rhysd rhysd added the bug Something isn't working label Jan 25, 2023
@rhysd
Copy link
Owner

rhysd commented Jan 25, 2023

This looks a bug that actionlint does not consider a case where both workflow_dispatch and workflow_call are having an input with the same name. I'll take a look.

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