[GH-ISSUE #499] jobs.*.strategy.matrix.include doesnt seem to be parsed correctly when used in a step's env. #343

Closed
opened 2026-03-01 21:42:32 +03:00 by kerem · 1 comment
Owner

Originally created by @bagel-dawg on GitHub (Jan 21, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/499

Here's an example workflow file that works in GIthub, but not in act:

---
name: "Test Platform GH Actions"

on:
  pull_request:
    types:
      - opened
      - synchronize
      - reopened

jobs:
  build:
    strategy:
      matrix:
        include:
          - example_var_1: "this_is_var_1"
            nested_var_1: "this_is_nested_var_1"
    runs-on: ubuntu-latest
    steps:

      - name: Show the environment
        run: |
          env
        env:
          ENV_VAR_1: "${{ matrix.example_var_1 }}"
          NESTED_ENV_VAR_1: "${{ matrix.nested_var_1 }}"

Expected output (truncated to the relevant parts):

[Test Platform GH Actions/build-2]   ✅  Success - Show the environment
| ENV_VAR_1=this_is_var_1
| NESTED_ENV_VAR_1=this_is_nested_var_1

Actual output:

[Test Platform GH Actions/build-2]   ✅  Success - Show the environment
| ENV_VAR_1=
| NESTED_ENV_VAR_1=
Originally created by @bagel-dawg on GitHub (Jan 21, 2021). Original GitHub issue: https://github.com/nektos/act/issues/499 Here's an example workflow file that works in GIthub, but not in act: ``` --- name: "Test Platform GH Actions" on: pull_request: types: - opened - synchronize - reopened jobs: build: strategy: matrix: include: - example_var_1: "this_is_var_1" nested_var_1: "this_is_nested_var_1" runs-on: ubuntu-latest steps: - name: Show the environment run: | env env: ENV_VAR_1: "${{ matrix.example_var_1 }}" NESTED_ENV_VAR_1: "${{ matrix.nested_var_1 }}" ``` Expected output (truncated to the relevant parts): ``` [Test Platform GH Actions/build-2] ✅ Success - Show the environment | ENV_VAR_1=this_is_var_1 | NESTED_ENV_VAR_1=this_is_nested_var_1 ``` Actual output: ``` [Test Platform GH Actions/build-2] ✅ Success - Show the environment | ENV_VAR_1= | NESTED_ENV_VAR_1= ```
kerem closed this issue 2026-03-01 21:42:32 +03:00
Author
Owner

@edtan commented on GitHub (Jan 23, 2021):

This seems to be working properly in v0.2.17, but broken in v0.2.18. One thing that I noticed is that in v0.2.18, this runs two job containers - the first job build-1 sets the environment variables correctly, but the second job build-2 does not.

<!-- gh-comment-id:766154055 --> @edtan commented on GitHub (Jan 23, 2021): This seems to be working properly in `v0.2.17`, but broken in `v0.2.18`. One thing that I noticed is that in `v0.2.18`, this runs two job containers - the first job `build-1` sets the environment variables correctly, but the second job `build-2` does not.
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#343
No description provided.