[GH-ISSUE #108] Matrix variable used in job name not expanded #70

Closed
opened 2026-03-01 21:39:45 +03:00 by kerem · 9 comments
Owner

Originally created by @davidalger on GitHub (Feb 27, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/108

Attempted to execute the workflow found here: https://github.com/davidalger/docker-images-php/blob/master/.github/workflows/build.yml

The result was the following (in many more colors than can be printed here):

[Docker Image CI/PHP ${{ matrix.php_version }}] 🧪  Matrix: map[php_version:73]
[Docker Image CI/PHP ${{ matrix.php_version }}] 🧪  Matrix: map[php_version:70]
[Docker Image CI/PHP ${{ matrix.php_version }}] 🧪  Matrix: map[php_version:55]
[Docker Image CI/PHP ${{ matrix.php_version }}] 🚀  Start image=node:12.6-buster-slim
[Docker Image CI/PHP ${{ matrix.php_version }}] 🧪  Matrix: map[php_version:72]
[Docker Image CI/PHP ${{ matrix.php_version }}] 🧪  Matrix: map[php_version:71]
[Docker Image CI/PHP ${{ matrix.php_version }}] 🚀  Start image=node:12.6-buster-slim
[Docker Image CI/PHP ${{ matrix.php_version }}] 🧪  Matrix: map[php_version:56]
[Docker Image CI/PHP ${{ matrix.php_version }}] 🚀  Start image=node:12.6-buster-slim
[Docker Image CI/PHP ${{ matrix.php_version }}] 🚀  Start image=node:12.6-buster-slim
[Docker Image CI/PHP ${{ matrix.php_version }}] 🚀  Start image=node:12.6-buster-slim
[Docker Image CI/PHP ${{ matrix.php_version }}] 🚀  Start image=node:12.6-buster-slim
[Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470
[Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470
[Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470
[Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470
[Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470
Error: Error response from daemon: Conflict. The container name "/act-Docker-Image-CI-PHP-----ma" is already in use by container "30044369114ef881ddc84604bcc398f185170a9fad1ef8821971ef80f561e33d". You have to remove (or rename) that container to be able to reuse that name.

Since the container name is being derived from the job name, the job completely fails. The job name should render out (for example) to "[Docker Image CI/PHP 7.3]"

Originally created by @davidalger on GitHub (Feb 27, 2020). Original GitHub issue: https://github.com/nektos/act/issues/108 Attempted to execute the workflow found here: https://github.com/davidalger/docker-images-php/blob/master/.github/workflows/build.yml The result was the following (in many more colors than can be printed here): ``` [Docker Image CI/PHP ${{ matrix.php_version }}] 🧪 Matrix: map[php_version:73] [Docker Image CI/PHP ${{ matrix.php_version }}] 🧪 Matrix: map[php_version:70] [Docker Image CI/PHP ${{ matrix.php_version }}] 🧪 Matrix: map[php_version:55] [Docker Image CI/PHP ${{ matrix.php_version }}] 🚀 Start image=node:12.6-buster-slim [Docker Image CI/PHP ${{ matrix.php_version }}] 🧪 Matrix: map[php_version:72] [Docker Image CI/PHP ${{ matrix.php_version }}] 🧪 Matrix: map[php_version:71] [Docker Image CI/PHP ${{ matrix.php_version }}] 🚀 Start image=node:12.6-buster-slim [Docker Image CI/PHP ${{ matrix.php_version }}] 🧪 Matrix: map[php_version:56] [Docker Image CI/PHP ${{ matrix.php_version }}] 🚀 Start image=node:12.6-buster-slim [Docker Image CI/PHP ${{ matrix.php_version }}] 🚀 Start image=node:12.6-buster-slim [Docker Image CI/PHP ${{ matrix.php_version }}] 🚀 Start image=node:12.6-buster-slim [Docker Image CI/PHP ${{ matrix.php_version }}] 🚀 Start image=node:12.6-buster-slim [Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470 [Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470 [Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470 [Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470 [Docker Image CI/PHP ${{ matrix.php_version }}] Error: No such container: d4933363ec5c85a025ac8911508a6f4a1c95f5270cfd11c70207ac6966076470 Error: Error response from daemon: Conflict. The container name "/act-Docker-Image-CI-PHP-----ma" is already in use by container "30044369114ef881ddc84604bcc398f185170a9fad1ef8821971ef80f561e33d". You have to remove (or rename) that container to be able to reuse that name. ``` Since the container name is being derived from the job name, the job completely fails. The job name should render out (for example) to "[Docker Image CI/PHP 7.3]"
Author
Owner

@cplee commented on GitHub (Feb 27, 2020):

fix is available now in master, will be in next release

<!-- gh-comment-id:591824616 --> @cplee commented on GitHub (Feb 27, 2020): fix is available now in master, will be in next release
Author
Owner

@davidalger commented on GitHub (Feb 27, 2020):

Awesome. Thank you!

<!-- gh-comment-id:592235311 --> @davidalger commented on GitHub (Feb 27, 2020): Awesome. Thank you!
Author
Owner

@cplee commented on GitHub (Feb 28, 2020):

available in v0.2.5

<!-- gh-comment-id:592647653 --> @cplee commented on GitHub (Feb 28, 2020): available in `v0.2.5`
Author
Owner

@alexkli commented on GitHub (Mar 4, 2020):

@cplee I get the same issue with v0.2.5:

> act --version
act version 0.2.5

> act
[CI/build] 🧪  Matrix: map[node-version:13.x]
[CI/build] 🧪  Matrix: map[node-version:8.x]
[CI/build] 🧪  Matrix: map[node-version:12.x]
[CI/build] 🧪  Matrix: map[node-version:10.x]
[CI/build] 🚀  Start image=node:12.6-buster-slim
[CI/build] 🚀  Start image=node:12.6-buster-slim
[CI/build] 🚀  Start image=node:12.6-buster-slim
[CI/build] 🚀  Start image=node:12.6-buster-slim
Error: Error response from daemon: Conflict. The container name "/act-CI-build" is already in use by container "f9645ee53d6d668a2e5629de23e75059c8caedfa998c79f3e1ed84ab02daf34e". You have to remove (or rename) that container to be able to reuse that name.

Here is the Github action yaml.

<!-- gh-comment-id:594255886 --> @alexkli commented on GitHub (Mar 4, 2020): @cplee I get the same issue with `v0.2.5`: ``` > act --version act version 0.2.5 > act [CI/build] 🧪 Matrix: map[node-version:13.x] [CI/build] 🧪 Matrix: map[node-version:8.x] [CI/build] 🧪 Matrix: map[node-version:12.x] [CI/build] 🧪 Matrix: map[node-version:10.x] [CI/build] 🚀 Start image=node:12.6-buster-slim [CI/build] 🚀 Start image=node:12.6-buster-slim [CI/build] 🚀 Start image=node:12.6-buster-slim [CI/build] 🚀 Start image=node:12.6-buster-slim Error: Error response from daemon: Conflict. The container name "/act-CI-build" is already in use by container "f9645ee53d6d668a2e5629de23e75059c8caedfa998c79f3e1ed84ab02daf34e". You have to remove (or rename) that container to be able to reuse that name. ``` Here is the [Github action yaml](https://github.com/alexkli/openwhisk-wskdebug/blob/c01e08017b981213b9abbcc81e7a3efc9c1c1222/.github/workflows/nodejs.yml).
Author
Owner

@alexkli commented on GitHub (Mar 4, 2020):

If I try to give my builds a name like the OP did, it doesn't help:

name: CI

on: [push]

jobs:
  build:
    name: Node ${{ matrix.node-version }}
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x, 10.x, 12.x, 13.x]

    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install
    - run: npm test -- -v
    #- run: npm run report-coverage
      env:
        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Result:

> act
ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] 
ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] 
ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] 
ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] 
[CI/Node ${{ matrix.node-version }}] 🧪  Matrix: map[node-version:13.x]
[CI/Node ${{ matrix.node-version }}] 🧪  Matrix: map[node-version:8.x]
[CI/Node ${{ matrix.node-version }}] 🚀  Start image=node:12.6-buster-slim
[CI/Node ${{ matrix.node-version }}] 🧪  Matrix: map[node-version:10.x]
[CI/Node ${{ matrix.node-version }}] 🚀  Start image=node:12.6-buster-slim
[CI/Node ${{ matrix.node-version }}] 🚀  Start image=node:12.6-buster-slim
[CI/Node ${{ matrix.node-version }}] 🧪  Matrix: map[node-version:12.x]
[CI/Node ${{ matrix.node-version }}] 🚀  Start image=node:12.6-buster-slim
Error: Error response from daemon: Conflict. The container name "/act-CI-Node-----matrix-node-ve" is already in use by container "52a10968257c61b39e658a5e50ff050e1e20536525ffb0ff35861893af80cc9f". You have to remove (or rename) that container to be able to reuse that name.
<!-- gh-comment-id:594257969 --> @alexkli commented on GitHub (Mar 4, 2020): If I try to give my builds a `name` like the OP did, it doesn't help: ``` name: CI on: [push] jobs: build: name: Node ${{ matrix.node-version }} runs-on: ubuntu-latest strategy: matrix: node-version: [8.x, 10.x, 12.x, 13.x] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test -- -v #- run: npm run report-coverage env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} ``` Result: ``` > act ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] ERRO[0000] Unable to interpolate string 'Node ${{ matrix.node-version }}' - [ReferenceError: 'version' is not defined] [CI/Node ${{ matrix.node-version }}] 🧪 Matrix: map[node-version:13.x] [CI/Node ${{ matrix.node-version }}] 🧪 Matrix: map[node-version:8.x] [CI/Node ${{ matrix.node-version }}] 🚀 Start image=node:12.6-buster-slim [CI/Node ${{ matrix.node-version }}] 🧪 Matrix: map[node-version:10.x] [CI/Node ${{ matrix.node-version }}] 🚀 Start image=node:12.6-buster-slim [CI/Node ${{ matrix.node-version }}] 🚀 Start image=node:12.6-buster-slim [CI/Node ${{ matrix.node-version }}] 🧪 Matrix: map[node-version:12.x] [CI/Node ${{ matrix.node-version }}] 🚀 Start image=node:12.6-buster-slim Error: Error response from daemon: Conflict. The container name "/act-CI-Node-----matrix-node-ve" is already in use by container "52a10968257c61b39e658a5e50ff050e1e20536525ffb0ff35861893af80cc9f". You have to remove (or rename) that container to be able to reuse that name. ```
Author
Owner

@alexkli commented on GitHub (Mar 4, 2020):

🎉 It works if I use node_version instead of node-version, to bypass the ReferenceError:

name: CI

on: [push]

jobs:
  build:
    name: Node ${{ matrix.node_version }}
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node_version: [8.x, 10.x, 12.x, 13.x]

    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node_version }}
    - run: npm install
    - run: npm test -- -v
    #- run: npm run report-coverage
      env:
        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Result:

> act
[CI/Node 13.x] 🧪  Matrix: map[node_version:13.x]
[CI/Node 10.x] 🧪  Matrix: map[node_version:10.x]
[CI/Node 8.x ] 🧪  Matrix: map[node_version:8.x]
[CI/Node 13.x] 🚀  Start image=node:12.6-buster-slim
[CI/Node 12.x] 🧪  Matrix: map[node_version:12.x]
[CI/Node 10.x] 🚀  Start image=node:12.6-buster-slim
[CI/Node 8.x ] 🚀  Start image=node:12.6-buster-slim
[CI/Node 12.x] 🚀  Start image=node:12.6-buster-slim
[CI/Node 10.x]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI/Node 12.x]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI/Node 8.x ]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI/Node 13.x]   🐳  docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
...
<!-- gh-comment-id:594263701 --> @alexkli commented on GitHub (Mar 4, 2020): 🎉 It works if I use `node_version` instead of `node-version`, to bypass the ReferenceError: ``` name: CI on: [push] jobs: build: name: Node ${{ matrix.node_version }} runs-on: ubuntu-latest strategy: matrix: node_version: [8.x, 10.x, 12.x, 13.x] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node_version }} - run: npm install - run: npm test -- -v #- run: npm run report-coverage env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} ``` Result: ``` > act [CI/Node 13.x] 🧪 Matrix: map[node_version:13.x] [CI/Node 10.x] 🧪 Matrix: map[node_version:10.x] [CI/Node 8.x ] 🧪 Matrix: map[node_version:8.x] [CI/Node 13.x] 🚀 Start image=node:12.6-buster-slim [CI/Node 12.x] 🧪 Matrix: map[node_version:12.x] [CI/Node 10.x] 🚀 Start image=node:12.6-buster-slim [CI/Node 8.x ] 🚀 Start image=node:12.6-buster-slim [CI/Node 12.x] 🚀 Start image=node:12.6-buster-slim [CI/Node 10.x] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CI/Node 12.x] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CI/Node 8.x ] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CI/Node 13.x] 🐳 docker run image=node:12.6-buster-slim entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] ... ```
Author
Owner

@cplee commented on GitHub (Mar 4, 2020):

Nice troubleshooting @alexkli

OK to close again?

<!-- gh-comment-id:594271164 --> @cplee commented on GitHub (Mar 4, 2020): Nice troubleshooting @alexkli OK to close again?
Author
Owner

@alexkli commented on GitHub (Mar 4, 2020):

I think there are still two issues that could be fixed/improved:

  • support matrix build jobs that don't have a name (my original yaml, perfectly fine in github)
  • support - in variable names
<!-- gh-comment-id:594271592 --> @alexkli commented on GitHub (Mar 4, 2020): I think there are still two issues that could be fixed/improved: - support matrix build jobs that don't have a `name` (my original yaml, perfectly fine in github) - support `-` in variable names
Author
Owner

@cplee commented on GitHub (Mar 4, 2020):

Will leave open for first bullet point. Second one is covered by #104 which I closed as wontfix 😞

<!-- gh-comment-id:594273477 --> @cplee commented on GitHub (Mar 4, 2020): Will leave open for first bullet point. Second one is covered by #104 which I closed as wontfix 😞
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#70
No description provided.