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

False Positive On fromJson in services Mapping Nodes #402

Closed
neilime opened this issue Feb 23, 2024 · 0 comments
Closed

False Positive On fromJson in services Mapping Nodes #402

neilime opened this issue Feb 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@neilime
Copy link

neilime commented Feb 23, 2024

When job.services is provided by a dynamic variable parsed fromJson, it fails because it think that the result is scalar, but fromJson is able to return Mapping nodes

The following example shows the action lint error, but this workflow is working pretty good

https://rhysd.github.io/actionlint/#eJyFUk1LAzEQvfdXDEVoC2aLKFUjghcvHlTUk1Iku5220d0k5GOL1P3vJtldcdst5pS8mXmTefOkoAOAjdSfy1xu3jOW53Qw+JCpCbjSqJhGUjLNWZpjBAG0E4ZIQcGlTlhHcmbR2BiSzipnmzyAgBtiUJc889VwtN2CsahM0o0kTd0ODFUViWJJy0mAL+gOcxMCcCa0YZnlUpjpitu1S4nJNFf2pjz7Tdv4AP19+QYxg8L3Hwwg8xy27vTc/ugatp2cqAcuuO+6HwiHF2yFFIYxKWepmcYbMp2t6UkySy6Gx72FSmovJLzNTs8v5/0pKMpDbcN5efV9b52WCqePfoXmQKeqH5Yqqug5CEFh9ZeSXNh62qg86h7CqoNUV4MdSTUmBu1D3Pd41F3j6Bjunh/uE2M1Fyu+/Bp3xJ9MIlvE6u0JVnhtXwLwnzMF4iLIuefpeW2xjkeXWhbhJ+NYlezVHPDrpDWsd45lXKBuTda4IKSTeO/zdT3NkxN/JmqmolCwT4z1P6q8DUE=

on:
  workflow_call:

jobs:
  prepare-variables:
    runs-on: ubuntu-latest
    outputs:
      tests-services: ${{ steps.tests-services.outputs.tests-services }}
    steps:
      - id: tests-services
        uses: actions/github-script@v4
        with:
          script: |
            const testsServices = {
                redis: {
                    image: "redislabs/redisearch:1.6.8",
                    ports: [6379],
                    env: {
                        TZ: "Europe/Paris",
                    },
                    options: "--entrypoint redis-server",
                }
            };

            core.setOutput('tests-services', JSON.stringify(testsServices));

  tests:
    name: Tests
    runs-on: ubuntu-latest
    needs: [prepare-variables]
    services: ${{ fromJSON(needs.prepare-variables.outputs.tests-services) }}
    container:
      image: test-image
    steps:
      - name: Run Tests
        run: make test
@rhysd rhysd added the bug Something isn't working label Feb 25, 2024
@rhysd rhysd closed this as completed in 2eeaa12 Feb 28, 2024
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