act icon indicating copy to clipboard operation
act copied to clipboard

Issue: parse all container/services options

Open catthehacker opened this issue 3 years ago • 7 comments

on: push

jobs:
  docker-container:
    runs-on: ubuntu-latest
    container:
      image: alpine
      options: --it --rm
    steps:
      - uses: actions/checkout@v2

catthehacker avatar Mar 01 '22 10:03 catthehacker

bump

bhaveshprajapat avatar Oct 03 '22 15:10 bhaveshprajapat

@bhaveshprajapat Feel free to create a pull request 😉

KnisterPeter avatar Oct 03 '22 15:10 KnisterPeter

@cplee @alex-savchuk This change contains a major issue. The workflow below does not return the hostname of the host but some other invalid fqdn. I'm not sure why this happens, but it is a side-effect of this PR. Reverting it does restore the previous behavior.

name: test
on: push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: hostname -f

KnisterPeter avatar Oct 07 '22 08:10 KnisterPeter

According to the docs, if no container is set, the job should run on the host. This was imitated with act until this fix was applied. We should restore the default behavior unless there is a container definition on a job.

KnisterPeter avatar Oct 07 '22 09:10 KnisterPeter

Checking it.

alex-savchuk avatar Oct 07 '22 13:10 alex-savchuk

@KnisterPeter Could you please provide output for previous output of hostname -f and new one? I checked and see "docker-desktop" for both cases :(

alex-savchuk avatar Oct 07 '22 13:10 alex-savchuk

The 'previous' output was the output of the host machine as act was used to start the docker container in network mode host. Now with your fix it is started with the default network mode. As you are parsing an empty string into docker options (using the cli tool) the output are all the docker defaults. Then you merge that into (and over) the act defaults. I've already build a fix for this: https://github.com/nektos/act/pull/1375

Please test if your change did not break with that. :smiley:

KnisterPeter avatar Oct 10 '22 07:10 KnisterPeter