[GH-ISSUE #631] Issue: Declared container in a job overrides default image #413

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

Originally created by @davido-nw on GitHub (Apr 23, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/631

Act version

act version 0.2.21

Expected behavior

Some of our workflows utilize a specific image by declaring an image in container.image within the job. The actual run of the workflow utilizes the base Ubuntu 18.04 environment - which has docker installed in it - to pull that image and run the job steps from within the images' container within the 18.04 environment.

This is also evident when manually starting a shell container from the catthehacker/ubuntu:act-18.04 image - that image contains docker and node installed, since it leverages node to run the action. But the nixos image that we use does not contain node. Running act on this workflow fails because it's expecting to call node which isn't present in the nixos image.

The TL;DR is: the expected behavior is that act would launch a container based off the catthehacker/ubuntu:act-18.04 image, and then pull the nixos image from within that container.

Actual behavior

Even if I explicitly state that I want to use the catthehacker/ubuntu:act-18.04 image by calling act pull_request -P ubuntu-18.04=catthehacker/ubuntu:act-18.04, the presence of a container.image within the job means it wants to actually run the action within that image (nixos).

What became evident by going through the verbose output is that it never bothered to start the catthehacker/ubuntu:act-18.04 container. Instead, it went straight to the nixos container, where it expected to be able to call node /actions/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/dist/index.js. This failed because node isn't in the nixos container.

Workflow and/or repository

workflow
name: Lint Nix Configs
on: pull_request

jobs:
  linter:
    name: Run nixpkgs-fmt
    runs-on: ubuntu-18.04

    # nixos/nix docker image v2.3 SHA
    container:
      image: nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8

    steps:
        # Checks out repository to docker container
        # Utilizes the commit from the open PR
        # Using SHA v2
      - name: Pulls Repository
        uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      
        # Parses through all nix files using nixpkgs-fmt, outputting the diff
        # between the modded one and original if one of the new nix configs are not properly formatted
        # NOTE: When using `diff` in GitHub Actions, it causes script to forcibly exit, so workaround is to
        # unset e so that the script will "ignore" whatever return value is leaking in the diff command
      - name: Verify Nix Configs
        id: format
        run: |
          <REDACTED>
        continue-on-error: false

Steps to reproduce

First, just to be clear, I only just started using this a couple of hours ago, so it's quite possible I might be misunderstanding something that isn't immediately obvious.

  1. Clone repo: https://github.com/nebulaworks/nix-garage
  2. Run act pull_request -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 -v

With or without the -P, it wants to go straight to the nixos image that's part of that job. Again, it's possible that I might be misunderstanding things, and that perhaps this is expected behavior, but my take on the expected behavior is that it should be properly emulating the "container within a container" setup correctly, since the 'outer' 18.04 container should be expected to contain node.

act output

Log
DEBU[0000] Loading environment from /home/my-username/nebulaworks/nix-garage/.env 
DEBU[0000] Loading secrets from /home/my-username/nebulaworks/nix-garage/.secrets 
DEBU[0000] Loading workflows from '/home/my-username/nebulaworks/nix-garage/.github/workflows' 
DEBU[0000] Reading workflow '/home/my-username/nebulaworks/nix-garage/.github/workflows/lint-nix.yml' 
DEBU[0000] Reading workflow '/home/my-username/nebulaworks/nix-garage/.github/workflows/publish_imgs.yml' 
DEBU[0000] Planning event: pull_request                 
DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' 
DEBU[0000] HEAD matches refs/heads/master               
DEBU[0000] using github ref: refs/heads/master          
DEBU[0000] context env => map[ACT:true]                 
[Lint Nix Configs/Run nixpkgs-fmt] 🚀  Start image=nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8
DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' 
DEBU[0000] HEAD matches refs/heads/master               
DEBU[0000] using github ref: refs/heads/master          
[Lint Nix Configs/Run nixpkgs-fmt]   🐳  docker pull nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8
DEBU[0000] Image exists? true                           
[Lint Nix Configs/Run nixpkgs-fmt] Removed container: a814b5cf28dd4dd4cc126469554c774e62d4553b71e649fa569e13bf14a2a3e2
[Lint Nix Configs/Run nixpkgs-fmt]   🐳  docker volume rm act-Lint-Nix-Configs-Run-nixpkgs-fmt
[Lint Nix Configs/Run nixpkgs-fmt]   🐳  docker create image=nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Lint Nix Configs/Run nixpkgs-fmt] Created container name=act-Lint-Nix-Configs-Run-nixpkgs-fmt id=80c0e4f54714bfccd3f8ea55728189dc19ead4bee3a1e11c515add52c6f3593d from image nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 (platform: linux/amd64)
[Lint Nix Configs/Run nixpkgs-fmt] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[Lint Nix Configs/Run nixpkgs-fmt]   🐳  docker run image=nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Lint Nix Configs/Run nixpkgs-fmt] Starting container: 80c0e4f54714bfccd3f8ea55728189dc19ead4bee3a1e11c515add52c6f3593d
[Lint Nix Configs/Run nixpkgs-fmt] Started container: 80c0e4f54714bfccd3f8ea55728189dc19ead4bee3a1e11c515add52c6f3593d
DEBU[0000] Writing entry to tarball workflow/event.json len:2 
DEBU[0000] Writing entry to tarball workflow/envs.txt len:0 
DEBU[0000] Writing entry to tarball home/.act len:0     
[Lint Nix Configs/Run nixpkgs-fmt] Extracting content to '/home/my-username/nebulaworks'
DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' 
DEBU[0000] HEAD matches refs/heads/master               
DEBU[0000] using github ref: refs/heads/master          
DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' 
DEBU[0000] HEAD matches refs/heads/master               
DEBU[0000] using github ref: refs/heads/master          
DEBU[0000] context env => map[ACT:true]                 
DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' 
DEBU[0000] HEAD matches refs/heads/master               
DEBU[0000] using github ref: refs/heads/master          
DEBU[0000] context env => map[ACT:true]                 
DEBU[0000] Evaluating 'github['event']['pull_request']['head']['sha']' instead of 'github.event.pull_request.head.sha' 
ERRO[0000] Unable to interpolate string '${{ github.event.pull_request.head.sha }}' - [TypeError: Cannot access member 'head' of undefined] 
DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_ENV:/home/my-username/nebulaworks/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/home/my-username/nebulaworks/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:Nebulaworks/nix-garage GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:a94ab0c742e933040c43cdedbe0910778ecf9b3a GITHUB_TOKEN: GITHUB_WORKFLOW:Lint Nix Configs GITHUB_WORKSPACE:/home/my-username/nebulaworks/nix-garage HOME:/home/my-username/nebulaworks/home INPUT_REF:${{ github.event.pull_request.head.sha }} ImageOS:ubuntu18.04] 
DEBU[0000] Evaluating 'github['event']['pull_request']['head']['sha']' instead of 'github.event.pull_request.head.sha' 
ERRO[0000] Unable to interpolate string '${{ github.event.pull_request.head.sha }}' - [TypeError: Cannot access member 'head' of undefined] 
[Lint Nix Configs/Run nixpkgs-fmt] setupEnv => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_ENV:/home/my-username/nebulaworks/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/home/my-username/nebulaworks/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:Nebulaworks/nix-garage GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:a94ab0c742e933040c43cdedbe0910778ecf9b3a GITHUB_TOKEN: GITHUB_WORKFLOW:Lint Nix Configs GITHUB_WORKSPACE:/home/my-username/nebulaworks/nix-garage HOME:/home/my-username/nebulaworks/home INPUT_REF: ImageOS:ubuntu18.04]
[Lint Nix Configs/Run nixpkgs-fmt] ⭐  Run Pulls Repository
DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' 
DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a 
DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' 
DEBU[0000] HEAD matches refs/heads/master               
DEBU[0000] using github ref: refs/heads/master          
[Lint Nix Configs/Run nixpkgs-fmt]   ☁  git clone 'https://github.com/actions/checkout' # ref=28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
[Lint Nix Configs/Run nixpkgs-fmt]   cloning https://github.com/actions/checkout to /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
[Lint Nix Configs/Run nixpkgs-fmt] Unable to pull refs/heads/28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b: worktree contains unstaged changes
[Lint Nix Configs/Run nixpkgs-fmt] Cloned https://github.com/actions/checkout to /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
[Lint Nix Configs/Run nixpkgs-fmt] Checked out 28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
DEBU[0001] Read action &{Checkout  Checkout a Git repository at a particular version map[clean:{Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching false true} fetch-depth:{Number of commits to fetch. 0 indicates all history. false 1} lfs:{Whether to download Git-LFS files false false} path:{Relative path under $GITHUB_WORKSPACE to place the repository false } persist-credentials:{Whether to configure the token or SSH key with the local git config false true} ref:{The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event.  Otherwise, uses the default branch.
 false } repository:{Repository name with owner. For example, actions/checkout false ${{ github.repository }}} ssh-key:{SSH key used to fetch the repository. The SSH key is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the SSH key.

We recommend using a service account with the least permissions necessary.

[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
 false } ssh-known-hosts:{Known hosts in addition to the user and global host key database. The public SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example, `ssh-keyscan github.com`. The public key for github.com is always implicitly added.
 false } ssh-strict:{Whether to perform strict host key checking. When true, adds the options `StrictHostKeyChecking=yes` and `CheckHostIP=no` to the SSH command line. Use the input `ssh-known-hosts` to configure additional hosts.
 false true} submodules:{Whether to checkout submodules: `true` to checkout submodules or `recursive` to recursively checkout submodules.

When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are converted to HTTPS.
 false false} token:{Personal access token (PAT) used to fetch the repository. The PAT is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the PAT.

We recommend using a service account with the least permissions necessary. Also when generating a new PAT, select the least scopes necessary.

[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
 false ${{ github.token }}}] map[] {node12 map[] dist/index.js  [] []} { }} from '/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/action.yml' 
DEBU[0001] About to run action &{Checkout  Checkout a Git repository at a particular version map[clean:{Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching false true} fetch-depth:{Number of commits to fetch. 0 indicates all history. false 1} lfs:{Whether to download Git-LFS files false false} path:{Relative path under $GITHUB_WORKSPACE to place the repository false } persist-credentials:{Whether to configure the token or SSH key with the local git config false true} ref:{The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event.  Otherwise, uses the default branch.
 false } repository:{Repository name with owner. For example, actions/checkout false ${{ github.repository }}} ssh-key:{SSH key used to fetch the repository. The SSH key is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the SSH key.

We recommend using a service account with the least permissions necessary.

[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
 false } ssh-known-hosts:{Known hosts in addition to the user and global host key database. The public SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example, `ssh-keyscan github.com`. The public key for github.com is always implicitly added.
 false } ssh-strict:{Whether to perform strict host key checking. When true, adds the options `StrictHostKeyChecking=yes` and `CheckHostIP=no` to the SSH command line. Use the input `ssh-known-hosts` to configure additional hosts.
 false true} submodules:{Whether to checkout submodules: `true` to checkout submodules or `recursive` to recursively checkout submodules.

When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are converted to HTTPS.
 false false} token:{Personal access token (PAT) used to fetch the repository. The PAT is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the PAT.

We recommend using a service account with the least permissions necessary. Also when generating a new PAT, select the least scopes necessary.

[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
 false ${{ github.token }}}] map[] {node12 map[] dist/index.js  [] []} { }} 
DEBU[0001] Evaluating 'github['repository']' instead of 'github.repository' 
DEBU[0001] Evaluating 'github['token']' instead of 'github.token' 
DEBU[0001] type=3 actionDir=/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b actionPath= Workdir=/home/my-username/nebulaworks/nix-garage ActionCacheDir=/home/my-username/.cache/act actionName=actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b containerActionDir=/actions 
DEBU[0001] Removing /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/.gitignore before docker cp 
[Lint Nix Configs/Run nixpkgs-fmt]   🐳  docker cp src=/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b dst=/actions/
[Lint Nix Configs/Run nixpkgs-fmt] Exec command '[mkdir -p /actions/]'
DEBU[0001] Writing tarball /tmp/act228650685 from /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b 
DEBU[0001] Stripping prefix:/home/my-username/.cache/act/ src:/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b 
[Lint Nix Configs/Run nixpkgs-fmt] Extracting content from '/tmp/act228650685' to '/actions/'
DEBU[0001] executing remote job container: [node /actions/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/dist/index.js] 
[Lint Nix Configs/Run nixpkgs-fmt] Exec command '[node /actions/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/dist/index.js]'
| OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"node\": executable file not found in $PATH": unknown
[Lint Nix Configs/Run nixpkgs-fmt]   ❌  Failure - Pulls Repository
Originally created by @davido-nw on GitHub (Apr 23, 2021). Original GitHub issue: https://github.com/nektos/act/issues/631 <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> ## Act version ```none act version 0.2.21 ``` ## Expected behavior Some of our workflows utilize a specific image by declaring an image in `container.image` within the job. The actual run of the workflow utilizes the base Ubuntu 18.04 environment - which has `docker` installed in it - to pull *that* image and run the job steps from within the images' container within the 18.04 environment. This is also evident when manually starting a shell container from the `catthehacker/ubuntu:act-18.04` image - that image contains `docker` and `node` installed, since it leverages `node` to run the action. But the `nixos` image that we use does not contain `node`. Running `act` on this workflow fails because it's expecting to call `node` which isn't present in the `nixos` image. The TL;DR is: the expected behavior is that `act` would launch a container based off the `catthehacker/ubuntu:act-18.04` image, and then pull the `nixos` image from within *that* container. ## Actual behavior Even if I explicitly state that I want to use the `catthehacker/ubuntu:act-18.04` image by calling `act pull_request -P ubuntu-18.04=catthehacker/ubuntu:act-18.04`, the presence of a `container.image` within the job means it wants to actually *run the action within that image* (`nixos`). What became evident by going through the verbose output is that it never bothered to start the `catthehacker/ubuntu:act-18.04` container. Instead, it went straight to the `nixos` container, where it expected to be able to call `node /actions/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/dist/index.js`. This failed because node isn't in the `nixos` container. ## Workflow and/or repository <details> <summary>workflow</summary> ```none name: Lint Nix Configs on: pull_request jobs: linter: name: Run nixpkgs-fmt runs-on: ubuntu-18.04 # nixos/nix docker image v2.3 SHA container: image: nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 steps: # Checks out repository to docker container # Utilizes the commit from the open PR # Using SHA v2 - name: Pulls Repository uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b with: ref: ${{ github.event.pull_request.head.sha }} # Parses through all nix files using nixpkgs-fmt, outputting the diff # between the modded one and original if one of the new nix configs are not properly formatted # NOTE: When using `diff` in GitHub Actions, it causes script to forcibly exit, so workaround is to # unset e so that the script will "ignore" whatever return value is leaking in the diff command - name: Verify Nix Configs id: format run: | <REDACTED> continue-on-error: false ``` </details> ## Steps to reproduce <!-- Make sure to include command you used to run `act` e.g.: 1. Clone example repo (https://github.com/cplee/github-actions-demo) 2. Enter cloned repo directory 3. Run `act -s SUPER_SECRET=im-a-value` --> First, just to be clear, I only just started using this a couple of hours ago, so it's quite possible I might be misunderstanding something that isn't immediately obvious. 1. Clone repo: https://github.com/nebulaworks/nix-garage 2. Run `act pull_request -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 -v` With or without the `-P`, it wants to go straight to the `nixos` image that's part of that job. Again, it's possible that I might be misunderstanding things, and that perhaps this is expected behavior, but my take on the expected behavior is that it should be properly emulating the "container within a container" setup correctly, since the 'outer' 18.04 container should be expected to contain `node`. ## `act` output <!-- Paste output from your terminal, use `-v` or `--verbose` for richer output --> <details> <summary>Log</summary> ```none DEBU[0000] Loading environment from /home/my-username/nebulaworks/nix-garage/.env DEBU[0000] Loading secrets from /home/my-username/nebulaworks/nix-garage/.secrets DEBU[0000] Loading workflows from '/home/my-username/nebulaworks/nix-garage/.github/workflows' DEBU[0000] Reading workflow '/home/my-username/nebulaworks/nix-garage/.github/workflows/lint-nix.yml' DEBU[0000] Reading workflow '/home/my-username/nebulaworks/nix-garage/.github/workflows/publish_imgs.yml' DEBU[0000] Planning event: pull_request DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] [Lint Nix Configs/Run nixpkgs-fmt] 🚀 Start image=nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master [Lint Nix Configs/Run nixpkgs-fmt] 🐳 docker pull nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 DEBU[0000] Image exists? true [Lint Nix Configs/Run nixpkgs-fmt] Removed container: a814b5cf28dd4dd4cc126469554c774e62d4553b71e649fa569e13bf14a2a3e2 [Lint Nix Configs/Run nixpkgs-fmt] 🐳 docker volume rm act-Lint-Nix-Configs-Run-nixpkgs-fmt [Lint Nix Configs/Run nixpkgs-fmt] 🐳 docker create image=nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Lint Nix Configs/Run nixpkgs-fmt] Created container name=act-Lint-Nix-Configs-Run-nixpkgs-fmt id=80c0e4f54714bfccd3f8ea55728189dc19ead4bee3a1e11c515add52c6f3593d from image nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 (platform: linux/amd64) [Lint Nix Configs/Run nixpkgs-fmt] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [Lint Nix Configs/Run nixpkgs-fmt] 🐳 docker run image=nixos/nix@sha256:af330838e838cedea2355e7ca267280fc9dd68615888f4e20972ec51beb101d8 platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Lint Nix Configs/Run nixpkgs-fmt] Starting container: 80c0e4f54714bfccd3f8ea55728189dc19ead4bee3a1e11c515add52c6f3593d [Lint Nix Configs/Run nixpkgs-fmt] Started container: 80c0e4f54714bfccd3f8ea55728189dc19ead4bee3a1e11c515add52c6f3593d DEBU[0000] Writing entry to tarball workflow/event.json len:2 DEBU[0000] Writing entry to tarball workflow/envs.txt len:0 DEBU[0000] Writing entry to tarball home/.act len:0 [Lint Nix Configs/Run nixpkgs-fmt] Extracting content to '/home/my-username/nebulaworks' DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] DEBU[0000] Evaluating 'github['event']['pull_request']['head']['sha']' instead of 'github.event.pull_request.head.sha' ERRO[0000] Unable to interpolate string '${{ github.event.pull_request.head.sha }}' - [TypeError: Cannot access member 'head' of undefined] DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_ENV:/home/my-username/nebulaworks/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/home/my-username/nebulaworks/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:Nebulaworks/nix-garage GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:a94ab0c742e933040c43cdedbe0910778ecf9b3a GITHUB_TOKEN: GITHUB_WORKFLOW:Lint Nix Configs GITHUB_WORKSPACE:/home/my-username/nebulaworks/nix-garage HOME:/home/my-username/nebulaworks/home INPUT_REF:${{ github.event.pull_request.head.sha }} ImageOS:ubuntu18.04] DEBU[0000] Evaluating 'github['event']['pull_request']['head']['sha']' instead of 'github.event.pull_request.head.sha' ERRO[0000] Unable to interpolate string '${{ github.event.pull_request.head.sha }}' - [TypeError: Cannot access member 'head' of undefined] [Lint Nix Configs/Run nixpkgs-fmt] setupEnv => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_ENV:/home/my-username/nebulaworks/workflow/envs.txt GITHUB_EVENT_NAME:pull_request GITHUB_EVENT_PATH:/home/my-username/nebulaworks/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:Nebulaworks/nix-garage GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:a94ab0c742e933040c43cdedbe0910778ecf9b3a GITHUB_TOKEN: GITHUB_WORKFLOW:Lint Nix Configs GITHUB_WORKSPACE:/home/my-username/nebulaworks/nix-garage HOME:/home/my-username/nebulaworks/home INPUT_REF: ImageOS:ubuntu18.04] [Lint Nix Configs/Run nixpkgs-fmt] ⭐ Run Pulls Repository DEBU[0000] Loading slug from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] Loading revision from git directory '/home/my-username/nebulaworks/nix-garage/.git' DEBU[0000] Found revision: a94ab0c742e933040c43cdedbe0910778ecf9b3a DEBU[0000] HEAD points to 'a94ab0c742e933040c43cdedbe0910778ecf9b3a' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master [Lint Nix Configs/Run nixpkgs-fmt] ☁ git clone 'https://github.com/actions/checkout' # ref=28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b [Lint Nix Configs/Run nixpkgs-fmt] cloning https://github.com/actions/checkout to /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b [Lint Nix Configs/Run nixpkgs-fmt] Unable to pull refs/heads/28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b: worktree contains unstaged changes [Lint Nix Configs/Run nixpkgs-fmt] Cloned https://github.com/actions/checkout to /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b [Lint Nix Configs/Run nixpkgs-fmt] Checked out 28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b DEBU[0001] Read action &{Checkout Checkout a Git repository at a particular version map[clean:{Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching false true} fetch-depth:{Number of commits to fetch. 0 indicates all history. false 1} lfs:{Whether to download Git-LFS files false false} path:{Relative path under $GITHUB_WORKSPACE to place the repository false } persist-credentials:{Whether to configure the token or SSH key with the local git config false true} ref:{The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event. Otherwise, uses the default branch. false } repository:{Repository name with owner. For example, actions/checkout false ${{ github.repository }}} ssh-key:{SSH key used to fetch the repository. The SSH key is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the SSH key. We recommend using a service account with the least permissions necessary. [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) false } ssh-known-hosts:{Known hosts in addition to the user and global host key database. The public SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example, `ssh-keyscan github.com`. The public key for github.com is always implicitly added. false } ssh-strict:{Whether to perform strict host key checking. When true, adds the options `StrictHostKeyChecking=yes` and `CheckHostIP=no` to the SSH command line. Use the input `ssh-known-hosts` to configure additional hosts. false true} submodules:{Whether to checkout submodules: `true` to checkout submodules or `recursive` to recursively checkout submodules. When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are converted to HTTPS. false false} token:{Personal access token (PAT) used to fetch the repository. The PAT is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the PAT. We recommend using a service account with the least permissions necessary. Also when generating a new PAT, select the least scopes necessary. [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) false ${{ github.token }}}] map[] {node12 map[] dist/index.js [] []} { }} from '/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/action.yml' DEBU[0001] About to run action &{Checkout Checkout a Git repository at a particular version map[clean:{Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching false true} fetch-depth:{Number of commits to fetch. 0 indicates all history. false 1} lfs:{Whether to download Git-LFS files false false} path:{Relative path under $GITHUB_WORKSPACE to place the repository false } persist-credentials:{Whether to configure the token or SSH key with the local git config false true} ref:{The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event. Otherwise, uses the default branch. false } repository:{Repository name with owner. For example, actions/checkout false ${{ github.repository }}} ssh-key:{SSH key used to fetch the repository. The SSH key is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the SSH key. We recommend using a service account with the least permissions necessary. [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) false } ssh-known-hosts:{Known hosts in addition to the user and global host key database. The public SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example, `ssh-keyscan github.com`. The public key for github.com is always implicitly added. false } ssh-strict:{Whether to perform strict host key checking. When true, adds the options `StrictHostKeyChecking=yes` and `CheckHostIP=no` to the SSH command line. Use the input `ssh-known-hosts` to configure additional hosts. false true} submodules:{Whether to checkout submodules: `true` to checkout submodules or `recursive` to recursively checkout submodules. When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are converted to HTTPS. false false} token:{Personal access token (PAT) used to fetch the repository. The PAT is configured with the local git config, which enables your scripts to run authenticated git commands. The post-job step removes the PAT. We recommend using a service account with the least permissions necessary. Also when generating a new PAT, select the least scopes necessary. [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) false ${{ github.token }}}] map[] {node12 map[] dist/index.js [] []} { }} DEBU[0001] Evaluating 'github['repository']' instead of 'github.repository' DEBU[0001] Evaluating 'github['token']' instead of 'github.token' DEBU[0001] type=3 actionDir=/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b actionPath= Workdir=/home/my-username/nebulaworks/nix-garage ActionCacheDir=/home/my-username/.cache/act actionName=actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b containerActionDir=/actions DEBU[0001] Removing /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/.gitignore before docker cp [Lint Nix Configs/Run nixpkgs-fmt] 🐳 docker cp src=/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b dst=/actions/ [Lint Nix Configs/Run nixpkgs-fmt] Exec command '[mkdir -p /actions/]' DEBU[0001] Writing tarball /tmp/act228650685 from /home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b DEBU[0001] Stripping prefix:/home/my-username/.cache/act/ src:/home/my-username/.cache/act/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b [Lint Nix Configs/Run nixpkgs-fmt] Extracting content from '/tmp/act228650685' to '/actions/' DEBU[0001] executing remote job container: [node /actions/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/dist/index.js] [Lint Nix Configs/Run nixpkgs-fmt] Exec command '[node /actions/actions-checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b/dist/index.js]' | OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"node\": executable file not found in $PATH": unknown [Lint Nix Configs/Run nixpkgs-fmt] ❌ Failure - Pulls Repository ``` </details>
kerem 2026-03-01 21:43:08 +03:00
Author
Owner

@catthehacker commented on GitHub (Apr 23, 2021):

From https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer

A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.

If you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.

To me, what you see happening, is correct behaviour according to GitHub documentation

<!-- gh-comment-id:825451641 --> @catthehacker commented on GitHub (Apr 23, 2021): From https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer > A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts. > > If you do not set a `container`, all steps will run directly on the host specified by `runs-on` unless a step refers to an action configured to run in a container. To me, what you see happening, is correct behaviour according to GitHub documentation
Author
Owner

@ChristopherHX commented on GitHub (Apr 23, 2021):

But the nixos image that we use does not contain node

I agree, Act behaves differently than the github runner at this point. I have no problem with it, act is different in many ways

The official runner doesn't execute node supplied by the docker image.

Correct is, node is executed inside the container.

Different is, the runner bind mounts it's own external tools (including node12) into the container and executes it's own version of node12 from the bind mount.

Reference: github.com/actions/runner@be9632302c/src/Runner.Worker/Handlers/NodeScriptActionHandler.cs (L84)

BTW: I'm working on something similar to act (with more official source code), to run github actions on my raspberry Pi 4 with gitea instead of github.

<!-- gh-comment-id:825596400 --> @ChristopherHX commented on GitHub (Apr 23, 2021): > But the nixos image that we use does not contain node I agree, Act behaves differently than the github runner at this point. _I have no problem with it, act is different in many ways_ The official runner doesn't execute node supplied by the docker image. Correct is, node is executed inside the container. Different is, the runner bind mounts it's own external tools (including node12) into the container and executes it's own version of node12 from the bind mount. Reference: https://github.com/actions/runner/blob/be9632302ceef50bfb36ea998cea9c94c75e5d4d/src/Runner.Worker/Handlers/NodeScriptActionHandler.cs#L84 BTW: I'm working on [something similar to act](https://github.com/ChristopherHX/runner.server) (with more official source code), to run github actions on my raspberry Pi 4 with gitea instead of github.
Author
Owner

@davido-nw commented on GitHub (Apr 28, 2021):

Thanks for the insights; I'm going to close this now.

<!-- gh-comment-id:828812325 --> @davido-nw commented on GitHub (Apr 28, 2021): Thanks for the insights; I'm going to close this now.
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#413
No description provided.