nektos / act

Run your GitHub Actions locally πŸš€
https://nektosact.com
MIT License
55.9k stars 1.4k forks source link

Issue: Environment variable USER is not set #543

Closed terlar closed 3 years ago

terlar commented 3 years ago

I was trying to execute cachix/install-nix-action@v12 but the script depends on the environment variable USER being set. This works on GitHub Actions. See: https://github.com/cachix/install-nix-action/blob/master/lib/install-nix.sh#L16

Act version

act version 0.2.19

Expected behaviour

cachix/install-nix-action@v12 executes successfully

Actual behaviour

[Build/Build NixOS configuration for kong-2  ]   🐳  docker cp src=/home/terje.larsen/.cache/act/cachix-install-nix-action@v12 dst=/actions/
| /actions/cachix-install-nix-action@v12/lib/install-nix.sh: line 16: USER: unbound variable
| child_process.js:656
|     throw err;
|     ^
| 
| Error: Command failed: /actions/cachix-install-nix-action@v12/lib/install-nix.sh
|     at checkExecSyncError (child_process.js:635:11)
|     at Object.execFileSync (child_process.js:653:15)
|     at Object.<anonymous> (/actions/cachix-install-nix-action@v12/lib/main.js:4:17)
|     at Module._compile (internal/modules/cjs/loader.js:999:30)
|     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
|     at Module.load (internal/modules/cjs/loader.js:863:32)
|     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
|     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
|     at internal/main/run_main_module.js:17:47 {
|   status: 1,
|   signal: null,
|   output: [ null, null, null ],
|   pid: 33,
|   stdout: null,
|   stderr: null
| }
[Build/Build NixOS configuration for kong-2  ]   ❌  Failure - cachix/install-nix-action@v12
Error: exit with `FAILURE`: 1

Workflow and/or repository

https://github.com/terlar/nix-config/blob/master/.github/workflows/build.yml

Steps to reproduce

  1. Clone https://github.com/terlar/nix-config
  2. Enter cloned repo directory
  3. Run act -j build_nixos_configurations

act output

Log ```none act -vj build_nixos_configurations DEBU[0000] Loading environment from /home/terje.larsen/src/github.com/terlar/nix-config/.env DEBU[0000] Loading secrets from /home/terje.larsen/src/github.com/terlar/nix-config/.secrets DEBU[0000] Loading workflows from '/home/terje.larsen/src/github.com/terlar/nix-config/.github/workflows' DEBU[0000] Reading workflow '/home/terje.larsen/src/github.com/terlar/nix-config/.github/workflows/build.yml' DEBU[0000] Planning job: build_nixos_configurations DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' 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 'matrix['host']' instead of 'matrix.host' DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' 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 'matrix['host']' instead of 'matrix.host' [Build/Build NixOS configuration for kong-2 ] πŸ§ͺ Matrix: map[host:kong] [Build/Build NixOS configuration for kong-2 ] πŸš€ Start image=catthehacker/ubuntu:act-latest [Build/Build NixOS configuration for beetle-1] πŸ§ͺ Matrix: map[host:beetle] [Build/Build NixOS configuration for beetle-1] πŸš€ Start image=catthehacker/ubuntu:act-latest DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] HEAD matches refs/heads/master [Build/Build NixOS configuration for kong-2 ] 🐳 docker pull catthehacker/ubuntu:act-latest DEBU[0000] using github ref: refs/heads/master [Build/Build NixOS configuration for beetle-1] 🐳 docker pull catthehacker/ubuntu:act-latest DEBU[0000] Image exists? true DEBU[0000] Image exists? true [Build/Build NixOS configuration for beetle-1] Removed container: d104b50c48c736ad5c488728dd2421f72fc39e8b9ef135caf9cf441990d11e03 [Build/Build NixOS configuration for beetle-1] 🐳 docker volume rm act-Build-Build-NixOS-configuration-for-beetle-1 [Build/Build NixOS configuration for kong-2 ] Removed container: a2d92a7812831a83f26acd8115f7d00c6d7bccb7deaf57bb25e6d8a76e372b52 [Build/Build NixOS configuration for beetle-1] 🐳 docker create image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build/Build NixOS configuration for kong-2 ] 🐳 docker volume rm act-Build-Build-NixOS-configuration-for-kong-2 [Build/Build NixOS configuration for kong-2 ] 🐳 docker create image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build/Build NixOS configuration for kong-2 ] Created container name=act-Build-Build-NixOS-configuration-for-kong-2 id=018d2dd8f47aaa5af22c3450134de190139e5571d300814391fc4459b5855322 from image catthehacker/ubuntu:act-latest [Build/Build NixOS configuration for kong-2 ] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [Build/Build NixOS configuration for kong-2 ] 🐳 docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build/Build NixOS configuration for kong-2 ] Starting container: 018d2dd8f47aaa5af22c3450134de190139e5571d300814391fc4459b5855322 [Build/Build NixOS configuration for beetle-1] Created container name=act-Build-Build-NixOS-configuration-for-beetle-1 id=600d93c472078d79a4d9cd8a33359c057fc1146eb8cb92472e3e7fe48b481aec from image catthehacker/ubuntu:act-latest [Build/Build NixOS configuration for beetle-1] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp] [Build/Build NixOS configuration for beetle-1] 🐳 docker run image=catthehacker/ubuntu:act-latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build/Build NixOS configuration for beetle-1] Starting container: 600d93c472078d79a4d9cd8a33359c057fc1146eb8cb92472e3e7fe48b481aec [Build/Build NixOS configuration for kong-2 ] Started container: 018d2dd8f47aaa5af22c3450134de190139e5571d300814391fc4459b5855322 [Build/Build NixOS configuration for kong-2 ] 🐳 docker cp src=/home/terje.larsen/src/github.com/terlar/nix-config/. dst=/github/workspace [Build/Build NixOS configuration for kong-2 ] Exec command '[mkdir -p /github/workspace]' [Build/Build NixOS configuration for beetle-1] Started container: 600d93c472078d79a4d9cd8a33359c057fc1146eb8cb92472e3e7fe48b481aec [Build/Build NixOS configuration for beetle-1] 🐳 docker cp src=/home/terje.larsen/src/github.com/terlar/nix-config/. dst=/github/workspace [Build/Build NixOS configuration for beetle-1] Exec command '[mkdir -p /github/workspace]' DEBU[0000] Writing tarball /run/user/1001/act232683668 from /home/terje.larsen/src/github.com/terlar/nix-config/. DEBU[0000] Stripping prefix:/home/terje.larsen/src/github.com/terlar/nix-config/ src:/home/terje.larsen/src/github.com/terlar/nix-config/. DEBU[0000] Writing tarball /run/user/1001/act365031139 from /home/terje.larsen/src/github.com/terlar/nix-config/. DEBU[0000] Stripping prefix:/home/terje.larsen/src/github.com/terlar/nix-config/ src:/home/terje.larsen/src/github.com/terlar/nix-config/. [Build/Build NixOS configuration for kong-2 ] Extracting content from '/run/user/1001/act232683668' to '/github/workspace' [Build/Build NixOS configuration for beetle-1] Extracting content from '/run/user/1001/act365031139' to '/github/workspace' 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 [Build/Build NixOS configuration for kong-2 ] Extracting content to '/github/' 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 [Build/Build NixOS configuration for beetle-1] Extracting content to '/github/' DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_FETCH-DEPTH:0] DEBU[0000] setupEnv: map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_FETCH-DEPTH:0] [Build/Build NixOS configuration for kong-2 ] ⭐ Run actions/checkout@v2 DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master [Build/Build NixOS configuration for kong-2 ] Skipping actions/checkout [Build/Build NixOS configuration for kong-2 ] βœ… Success - actions/checkout@v2 DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_FETCH-DEPTH:0] DEBU[0000] setupEnv: map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_FETCH-DEPTH:0] [Build/Build NixOS configuration for beetle-1] ⭐ Run actions/checkout@v2 DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master [Build/Build NixOS configuration for beetle-1] Skipping actions/checkout [Build/Build NixOS configuration for beetle-1] βœ… Success - actions/checkout@v2 DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:1 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_EXTRA_NIX_CONFIG:experimental-features = nix-command flakes INPUT_INSTALL_URL:https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210126_f15f0b8/install] DEBU[0000] setupEnv: map[ACT:true CI:true GITHUB_ACTION:1 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_EXTRA_NIX_CONFIG:experimental-features = nix-command flakes INPUT_INSTALL_URL:https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210126_f15f0b8/install] [Build/Build NixOS configuration for kong-2 ] ⭐ Run cachix/install-nix-action@v12 [Build/Build NixOS configuration for kong-2 ] ☁ git clone 'https://github.com/cachix/install-nix-action' # ref=v12 [Build/Build NixOS configuration for kong-2 ] cloning https://github.com/cachix/install-nix-action to /home/terje.larsen/.cache/act/cachix-install-nix-action@v12 DEBU[0000] Loading slug from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] Loading revision from git directory '/home/terje.larsen/src/github.com/terlar/nix-config/.git' DEBU[0000] Found revision: d9bbbf540af309eec2f61a2976e894a0be195c21 DEBU[0000] HEAD points to 'd9bbbf540af309eec2f61a2976e894a0be195c21' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true] DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:1 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_EXTRA_NIX_CONFIG:experimental-features = nix-command flakes INPUT_INSTALL_URL:https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210126_f15f0b8/install] DEBU[0000] setupEnv: map[ACT:true CI:true GITHUB_ACTION:1 GITHUB_ACTIONS:true GITHUB_ACTOR:nektos/act GITHUB_ENV:/github/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/github/workflow/event.json GITHUB_REF:refs/heads/master GITHUB_REPOSITORY:ssh://git@github.com/terlar/nix-config GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SHA:d9bbbf540af309eec2f61a2976e894a0be195c21 GITHUB_TOKEN: GITHUB_WORKFLOW:Build GITHUB_WORKSPACE:/github/workspace HOME:/github/home INPUT_EXTRA_NIX_CONFIG:experimental-features = nix-command flakes INPUT_INSTALL_URL:https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210126_f15f0b8/install] [Build/Build NixOS configuration for beetle-1] ⭐ Run cachix/install-nix-action@v12 [Build/Build NixOS configuration for beetle-1] ☁ git clone 'https://github.com/cachix/install-nix-action' # ref=v12 [Build/Build NixOS configuration for beetle-1] cloning https://github.com/cachix/install-nix-action to /home/terje.larsen/.cache/act/cachix-install-nix-action@v12 [Build/Build NixOS configuration for kong-2 ] Unable to pull refs/heads/v12: worktree contains unstaged changes [Build/Build NixOS configuration for kong-2 ] Cloned https://github.com/cachix/install-nix-action to /home/terje.larsen/.cache/act/cachix-install-nix-action@v12 [Build/Build NixOS configuration for kong-2 ] Checked out v12 DEBU[0001] Read action &{Install Nix Domen KoΕΎar Installs Nix on GitHub Actions for the supported platforms: Linux and macOS. map[extra_nix_config:{gets appended to `/etc/nix/nix.conf` if passed. false } install_url:{Installation URL that will contain a script to install Nix false } nix_path:{Set NIX_PATH environment variable. false }] map[] {node12 map[] lib/main.js [] []} {blue sun}} from '/home/terje.larsen/.cache/act/cachix-install-nix-action@v12/action.yml' DEBU[0001] About to run action &{Install Nix Domen KoΕΎar Installs Nix on GitHub Actions for the supported platforms: Linux and macOS. map[extra_nix_config:{gets appended to `/etc/nix/nix.conf` if passed. false } install_url:{Installation URL that will contain a script to install Nix false } nix_path:{Set NIX_PATH environment variable. false }] map[] {node12 map[] lib/main.js [] []} {blue sun}} DEBU[0001] type=3 actionDir=/home/terje.larsen/.cache/act/cachix-install-nix-action@v12 actionPath= Workdir=/home/terje.larsen/src/github.com/terlar/nix-config ActionCacheDir=/home/terje.larsen/.cache/act actionName=cachix-install-nix-action@v12 containerActionDir=/actions DEBU[0001] Removing /home/terje.larsen/.cache/act/cachix-install-nix-action@v12/.gitignore before docker cp [Build/Build NixOS configuration for kong-2 ] 🐳 docker cp src=/home/terje.larsen/.cache/act/cachix-install-nix-action@v12 dst=/actions/ [Build/Build NixOS configuration for kong-2 ] Exec command '[mkdir -p /actions/]' DEBU[0001] Writing tarball /run/user/1001/act950684902 from /home/terje.larsen/.cache/act/cachix-install-nix-action@v12 DEBU[0001] Stripping prefix:/home/terje.larsen/.cache/act/ src:/home/terje.larsen/.cache/act/cachix-install-nix-action@v12 [Build/Build NixOS configuration for kong-2 ] Extracting content from '/run/user/1001/act950684902' to '/actions/' DEBU[0001] executing remote job container: [node /actions/cachix-install-nix-action@v12/lib/main.js] [Build/Build NixOS configuration for kong-2 ] Exec command '[node /actions/cachix-install-nix-action@v12/lib/main.js]' | /actions/cachix-install-nix-action@v12/lib/install-nix.sh: line 16: USER: unbound variable | child_process.js:656 | throw err; | ^ | | Error: Command failed: /actions/cachix-install-nix-action@v12/lib/install-nix.sh | at checkExecSyncError (child_process.js:635:11) | at Object.execFileSync (child_process.js:653:15) | at Object. (/actions/cachix-install-nix-action@v12/lib/main.js:4:17) | at Module._compile (internal/modules/cjs/loader.js:999:30) | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) | at Module.load (internal/modules/cjs/loader.js:863:32) | at Function.Module._load (internal/modules/cjs/loader.js:708:14) | at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) | at internal/main/run_main_module.js:17:47 { | status: 1, | signal: null, | output: [ null, null, null ], | pid: 31, | stdout: null, | stderr: null | } [Build/Build NixOS configuration for kong-2 ] ❌ Failure - cachix/install-nix-action@v12 DEBU[0001] exit with `FAILURE`: 1 DEBU[0001] exit with `FAILURE`: 1 DEBU[0001] exit with `FAILURE`: 1 Error: exit with `FAILURE`: 1 ```
CohenCyril commented 3 years ago

Same problem here in a different repository

CohenCyril commented 3 years ago

The problem is solved by adding --env USER=myusername to the command line, but then another failure appears when trying to install nix

jsoref commented 3 years ago

Using a tool I wrote for something else... https://github.com/jsoref/gha-debug/runs/2017914814?check_suite_focus=true

GitHub ``` AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache ANDROID_HOME=/usr/local/lib/android/sdk ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk-bundle ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk-bundle ANDROID_SDK_ROOT=/usr/local/lib/android/sdk ANT_HOME=/usr/share/ant AZURE_EXTENSION_DIR=/opt/az/azcliextensions BOOST_ROOT_1_72_0=/opt/hostedtoolcache/boost/1.72.0/x64 BOOTSTRAP_HASKELL_NONINTERACTIVE=1 CHROMEWEBDRIVER=/usr/local/share/chrome_driver CHROME_BIN=/usr/bin/google-chrome CI=true CONDA=/usr/share/miniconda DEBIAN_FRONTEND=noninteractive DEPLOYMENT_BASEPATH=/opt/runner DOTNET_MULTILEVEL_LOOKUP=0 DOTNET_NOLOGO=1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 GECKOWEBDRIVER=/usr/local/share/gecko_driver GITHUB_ACTION=run2 GITHUB_ACTIONS=true GITHUB_ACTION_REF= GITHUB_ACTION_REPOSITORY= GITHUB_ACTOR=jsoref GITHUB_API_URL=https://api.github.com GITHUB_BASE_REF= GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_b9659a7c-aad0-4984-83d7-702fbfbb212b GITHUB_EVENT_NAME=push GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json GITHUB_GRAPHQL_URL=https://api.github.com/graphql GITHUB_HEAD_REF= GITHUB_JOB=build GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_b9659a7c-aad0-4984-83d7-702fbfbb212b GITHUB_REF=refs/heads/main GITHUB_REPOSITORY=jsoref/gha-debug GITHUB_REPOSITORY_OWNER=jsoref GITHUB_RETENTION_DAYS=90 GITHUB_RUN_ID=615846162 GITHUB_RUN_NUMBER=8 GITHUB_SERVER_URL=https://github.com GITHUB_SHA=4982c105c248122f310cf05c11fd050b3293d229 GITHUB_WORKFLOW=Debug GITHUB_WORKSPACE=/home/runner/work/gha-debug/gha-debug GOROOT=/opt/hostedtoolcache/go/1.15.8/x64 GOROOT_1_13_X64=/opt/hostedtoolcache/go/1.13.15/x64 GOROOT_1_14_X64=/opt/hostedtoolcache/go/1.14.15/x64 GOROOT_1_15_X64=/opt/hostedtoolcache/go/1.15.8/x64 GRADLE_HOME=/usr/share/gradle HOME=/home/runner HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar" HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=3650 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew" HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew" INVOCATION_ID=cf44682287d6431da649601ec0fc1a87 ImageOS=ubuntu18 ImageVersion=20210219.1 JAVA_HOME=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64 JAVA_HOME_11_X64=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64 JAVA_HOME_12_X64=/usr/lib/jvm/adoptopenjdk-12-hotspot-amd64 JAVA_HOME_8_X64=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64 JOURNAL_STREAM=9:20111 LANG=C.UTF-8 LEIN_HOME=/usr/local/lib/lein LEIN_JAR=/usr/local/lib/lein/self-installs/leiningen-2.9.5-standalone.jar PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/opt/pipx_bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin PERFLOG_LOCATION_SETTING=RUNNER_PERFLOG PIPX_BIN_DIR=/opt/pipx_bin PIPX_HOME=/opt/pipx POWERSHELL_DISTRIBUTION_CHANNEL=GitHub-Actions-ubuntu18 RUNNER_OS=Linux RUNNER_PERFLOG=/home/runner/perflog RUNNER_TEMP=/home/runner/work/_temp RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_TRACKING_ID=github_c5f7f2be-3b74-4305-b493-08b9e3b4b8a9 RUNNER_USER=runner RUNNER_WORKSPACE=/home/runner/work/gha-debug SELENIUM_JAR_PATH=/usr/share/java/selenium-server-standalone.jar SHLVL=1 SWIFT_PATH=/usr/share/swift/usr/bin USER=runner VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg _=/usr/bin/env ```
Act ``` ACT=true CI=true GITHUB_ACTION=1 GITHUB_ACTIONS=true GITHUB_ACTOR=nektos/act GITHUB_API_URL=https://api.github.com GITHUB_ENV=/Users/jsoref/code/spelling-org/workflow/envs.txt GITHUB_EVENT_NAME=push GITHUB_EVENT_PATH=/Users/jsoref/code/spelling-org/workflow/event.json GITHUB_GRAPHQL_URL=https://api.github.com/graphql GITHUB_REF=refs/heads/main GITHUB_REPOSITORY=jsoref/gha-debug GITHUB_RUN_ID=1 GITHUB_RUN_NUMBER=1 GITHUB_SERVER_URL=https://github.com GITHUB_SHA=4982c105c248122f310cf05c11fd050b3293d229 GITHUB_TOKEN= GITHUB_WORKFLOW=Debug GITHUB_WORKSPACE=/Users/jsoref/code/spelling-org/gha-debug HOME=/root HOSTNAME=docker-desktop ImageOS=ubuntu18.04 NODE_VERSION=12.20.1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/Users/jsoref/code/spelling-org/gha-debug RUNNER_OS=Linux RUNNER_TEMP=/tmp RUNNER_TOOL_CACHE=/opt/hostedtoolcache SHLVL=1 YARN_VERSION=1.22.5 _=/usr/bin/env ```
GitHub additions ``` AGENT_TOOLSDIRECTORY ANDROID_HOME ANDROID_NDK_HOME ANDROID_NDK_ROOT ANDROID_SDK_ROOT ANT_HOME AZURE_EXTENSION_DIR BOOST_ROOT_1_72_0 BOOTSTRAP_HASKELL_NONINTERACTIVE CHROMEWEBDRIVER CHROME_BIN CONDA DEBIAN_FRONTEND DEPLOYMENT_BASEPATH DOTNET_MULTILEVEL_LOOKUP DOTNET_NOLOGO DOTNET_SKIP_FIRST_TIME_EXPERIENCE GECKOWEBDRIVER GITHUB_ACTION_REF GITHUB_ACTION_REPOSITORY GITHUB_BASE_REF GITHUB_HEAD_REF GITHUB_JOB GITHUB_PATH GITHUB_REPOSITORY_OWNER GITHUB_RETENTION_DAYS GOROOT GOROOT_1_13_X64 GOROOT_1_14_X64 GOROOT_1_15_X64 GRADLE_HOME HOMEBREW_CELLAR HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS HOMEBREW_NO_AUTO_UPDATE HOMEBREW_PREFIX HOMEBREW_REPOSITORY INVOCATION_ID ImageVersion JAVA_HOME JAVA_HOME_11_X64 JAVA_HOME_12_X64 JAVA_HOME_8_X64 JOURNAL_STREAM LANG LEIN_HOME LEIN_JAR PERFLOG_LOCATION_SETTING PIPX_BIN_DIR PIPX_HOME POWERSHELL_DISTRIBUTION_CHANNEL RUNNER_PERFLOG RUNNER_TRACKING_ID RUNNER_USER RUNNER_WORKSPACE SELENIUM_JAR_PATH SWIFT_PATH USER VCPKG_INSTALLATION_ROOT ```
Act additions ``` ACT GITHUB_TOKEN HOSTNAME NODE_VERSION PWD YARN_VERSION ```

Offhand, I think this is what I'd want:

Var Value
GITHUB_ACTION_REF ''
GITHUB_ACTION_REPOSITORY ''
GITHUB_BASE_REF ''
GITHUB_HEAD_REF ''
GITHUB_JOB = parse from workflow (it's the active child of the top level jobs)
GITHUB_PATH '' (or not set?)
GITHUB_REPOSITORY_OWNER = guess from origin
GITHUB_RETENTION_DAYS 0
RUNNER_PERFLOG /dev/null

RUNNER_TRACKING_ID RUNNER_USER | runner RUNNER_WORKSPACE | = GITHUB_WORKSPACE USER | runner

github-actions[bot] commented 3 years ago

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

jsoref commented 3 years ago

In progress

catthehacker commented 3 years ago

Fixed via #667