[GH-ISSUE #1628] Comment in first line of dot files cause a crash #812

Closed
opened 2026-03-01 21:46:35 +03:00 by kerem · 2 comments
Owner

Originally created by @abrahamduran on GitHub (Feb 14, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1628

Bug report info

act version:            0.2.42
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
	/Users/abraham/.docker/run/docker.sock
Config files:           
Build info:
	Go version:            go1.19.5
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -X main.version=0.2.42
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               arm64
		GOOS:                 darwin
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Docker Desktop
	OS type:               linux
	OS version:            
	OS arch:               aarch64
	OS kernel:             5.15.49-linuxkit
	OS CPU:                5
	OS memory:             7951 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

`act --container-architecture linux/amd64`

Describe issue

The provided command produces the following error:

FATA[0000] Error loading from /project_directory/.env: Can't separate key from value

This happens because the .env file contains a comment in the first line.

For example:

# Environment
TIMEZONE=America/Santo_Domingo

No response

Workflow content

N/A

Relevant log output

N/A

Additional information

No response

Originally created by @abrahamduran on GitHub (Feb 14, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1628 ### Bug report info ```plain text act version: 0.2.42 GOOS: darwin GOARCH: arm64 NumCPU: 10 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock /Users/abraham/.docker/run/docker.sock Config files: Build info: Go version: go1.19.5 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -compiler: gc -ldflags: -X main.version=0.2.42 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: arm64 GOOS: darwin Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: aarch64 OS kernel: 5.15.49-linuxkit OS CPU: 5 OS memory: 7951 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh `act --container-architecture linux/amd64` ``` ### Describe issue The provided command produces the following error: ``` FATA[0000] Error loading from /project_directory/.env: Can't separate key from value ``` This happens because the `.env` file contains a comment in the first line. For example: ``` # Environment TIMEZONE=America/Santo_Domingo ``` ### Link to GitHub repository _No response_ ### Workflow content ```yml N/A ``` ### Relevant log output ```sh N/A ``` ### Additional information _No response_
kerem 2026-03-01 21:46:35 +03:00
Author
Owner

@alex-savchuk commented on GitHub (Mar 3, 2023):

Hello,

Parsing of .env file is performed using github.com/joho/godotenv library.
This dependency was updated in https://github.com/nektos/act/releases/tag/v0.2.43

build(deps): bump github.com/joho/godotenv from 1.4.0 to 1.5.1 (https://github.com/nektos/act/pull/1614)

So please update to this version and check.

<!-- gh-comment-id:1453873162 --> @alex-savchuk commented on GitHub (Mar 3, 2023): Hello, Parsing of .env file is performed using github.com/joho/godotenv library. This dependency was updated in https://github.com/nektos/act/releases/tag/v0.2.43 ``` build(deps): bump github.com/joho/godotenv from 1.4.0 to 1.5.1 (https://github.com/nektos/act/pull/1614) ``` So please update to this version and check.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 1, 2023):

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

<!-- gh-comment-id:1701933321 --> @github-actions[bot] commented on GitHub (Sep 1, 2023): Issue is stale and will be closed in 14 days unless there is new activity
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#812
No description provided.