[GH-ISSUE #435] act fails to interpolate matrix variable in step with: arguments #301

Closed
opened 2026-03-01 21:42:11 +03:00 by kerem · 3 comments
Owner

Originally created by @artis3n on GitHub (Dec 1, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/435

I have a step in a workflow that looks like:

      - name: "Conftest Verify"
        uses: docker://openpolicyagent/conftest:v0.21.0
        with:
          entrypoint: conftest
          # github mounts the project at /github/workspace for us
          args: verify -p /github/workspace/${{ matrix.policyDir }}/**/*/src.rego -d /github/workspace/lib/

Where the strategy matrix is:

    strategy:
      fail-fast: false
      matrix:
        policyDir: ['nonblocking'] # ['nonblocking', 'blocking']

This works correctly on an actual github action workflow. However, act does not interpolate the matrix variable in the with: argument:

[Conftest CI/Validate Rego Syntax & Test Policies]   🐳  docker run image=openpolicyagent/conftest:v0.21.0 entrypoint=["conftest"] cmd=["verify" "-p" "/github/workspace/${{" "matrix.policyDir" "}}/**/*/src.rego" "-d" "/github/workspace/lib/"]
| Error: running verification: load failed: read rego files: search rego files: walk path: lstat /github/workspace/${{: no such file or directory

The path is passed into the docker container which then fails to traverse that directory tree because ${{ is still present in the path.

Originally created by @artis3n on GitHub (Dec 1, 2020). Original GitHub issue: https://github.com/nektos/act/issues/435 I have a step in a workflow that looks like: ```yaml - name: "Conftest Verify" uses: docker://openpolicyagent/conftest:v0.21.0 with: entrypoint: conftest # github mounts the project at /github/workspace for us args: verify -p /github/workspace/${{ matrix.policyDir }}/**/*/src.rego -d /github/workspace/lib/ ``` Where the strategy matrix is: ```yaml strategy: fail-fast: false matrix: policyDir: ['nonblocking'] # ['nonblocking', 'blocking'] ``` This works correctly on an actual github action workflow. However, `act` does not interpolate the matrix variable in the `with:` argument: ```bash [Conftest CI/Validate Rego Syntax & Test Policies] 🐳 docker run image=openpolicyagent/conftest:v0.21.0 entrypoint=["conftest"] cmd=["verify" "-p" "/github/workspace/${{" "matrix.policyDir" "}}/**/*/src.rego" "-d" "/github/workspace/lib/"] | Error: running verification: load failed: read rego files: search rego files: walk path: lstat /github/workspace/${{: no such file or directory ``` The path is passed into the docker container which then fails to traverse that directory tree because `${{` is still present in the path.
kerem closed this issue 2026-03-01 21:42:12 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:761279527 --> @github-actions[bot] commented on GitHub (Jan 16, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@artis3n commented on GitHub (Jan 16, 2021):

I feel like this should be fixed and not auto-closed, so bump

<!-- gh-comment-id:761619797 --> @artis3n commented on GitHub (Jan 16, 2021): I feel like this should be fixed and not auto-closed, so bump
Author
Owner

@karolswdev commented on GitHub (Jan 21, 2021):

Bumping this one.

<!-- gh-comment-id:764834226 --> @karolswdev commented on GitHub (Jan 21, 2021): Bumping this one.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#301
No description provided.