[GH-ISSUE #2487] Yaml files other than valid workflow files are considered invalid workflow files #1147

Closed
opened 2026-03-01 21:49:17 +03:00 by kerem · 4 comments
Owner

Originally created by @johannesmarx on GitHub (Oct 16, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2487

Bug report info

act version:            0.2.68
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
Config files:
	/Users/<user>/.actrc:
		-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
		-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
	.actrc:
		--container-architecture=linux/amd64
		--action-offline-mode
Build info:
	Go version:            go1.23.1
	Module path:           command-line-arguments
	Main version:
	Main path:
	Main checksum:
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -X main.version=0.2.68
		DefaultGODEBUG:       asynctimerchan=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,tls10server=1,tls3des=1,tlskyber=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1
		CGO_ENABLED:          1
		CGO_CFLAGS:
		CGO_CPPFLAGS:
		CGO_CXXFLAGS:
		CGO_LDFLAGS:
		GOARCH:               arm64
		GOOS:                 darwin
		GOARM64:              v8.0
Docker Engine:
	Engine version:        5.1.1
	Engine runtime:        crun
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay
	Registry URI:
	OS:                    fedora
	OS type:               linux
	OS version:            40
	OS arch:               arm64
	OS kernel:             6.8.11-300.fc40.aarch64
	OS CPU:                6
	OS memory:             1949 MB
	Security options:
		name=seccomp,profile=default
		name=rootless
		name=selinux

Command used with act

act -l

Describe issue

I'm currently having configuration files in .github/workflow that are Yaml files but are not any workflow files.
These configuration files e.g. .github/workflow/myconfig.yml are used by applications I invoke in my Github workflows but are not any workflow files.

Thanks a lot in advance

No response

Workflow content

I guess this won't help as it's about detecting workflow files vs. non-workflow files.

Relevant log output

DEBU[0000] Reading workflow '/Users/<user>/test-repo/.github/workflows/myconfig.yml'
Error: workflow is not valid. 'myconfig.yml': Line: 1 Column 1: Unknown Property test

Additional information

No response

Originally created by @johannesmarx on GitHub (Oct 16, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2487 ### Bug report info ```plain text act version: 0.2.68 GOOS: darwin GOARCH: arm64 NumCPU: 12 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /Users/<user>/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 .actrc: --container-architecture=linux/amd64 --action-offline-mode Build info: Go version: go1.23.1 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -X main.version=0.2.68 DefaultGODEBUG: asynctimerchan=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,tls10server=1,tls3des=1,tlskyber=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: arm64 GOOS: darwin GOARM64: v8.0 Docker Engine: Engine version: 5.1.1 Engine runtime: crun Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay Registry URI: OS: fedora OS type: linux OS version: 40 OS arch: arm64 OS kernel: 6.8.11-300.fc40.aarch64 OS CPU: 6 OS memory: 1949 MB Security options: name=seccomp,profile=default name=rootless name=selinux ``` ### Command used with act ```sh act -l ``` ### Describe issue I'm currently having configuration files in `.github/workflow` that are Yaml files but are not any workflow files. These configuration files e.g. `.github/workflow/myconfig.yml` are used by applications I invoke in my Github workflows but are not any workflow files. Thanks a lot in advance ### Link to GitHub repository _No response_ ### Workflow content ```yml I guess this won't help as it's about detecting workflow files vs. non-workflow files. ``` ### Relevant log output ```sh DEBU[0000] Reading workflow '/Users/<user>/test-repo/.github/workflows/myconfig.yml' Error: workflow is not valid. 'myconfig.yml': Line: 1 Column 1: Unknown Property test ``` ### Additional information _No response_
kerem 2026-03-01 21:49:17 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ChristopherHX commented on GitHub (Oct 16, 2024):

it's about detecting workflow files vs. non-workflow files.

Act never had such a feature and is only mentioned as a small comment in your issue

Please discuss this in https://github.com/nektos/act/issues/2414, e.g. feature removal of workflow schema validation needs good reasons.

If your config is not a yaml file or a file in a subfolder I agree about a defect

The -W cli switch also support the path to a valid workflow, I don't think run everything is good practice

<!-- gh-comment-id:2417285860 --> @ChristopherHX commented on GitHub (Oct 16, 2024): > it's about detecting workflow files vs. non-workflow files. Act never had such a feature and is only mentioned as a small comment in your issue Please discuss this in https://github.com/nektos/act/issues/2414, e.g. feature removal of workflow schema validation needs good reasons. If your config is not a yaml file or a file in a subfolder I agree about a defect The `-W` cli switch also support the path to a valid workflow, I don't think run everything is good practice
Author
Owner

@johannesmarx commented on GitHub (Oct 21, 2024):

Hi @ChristopherHX, thanks for your response. Maybe I didn't manage to describe the error well enough (also happy to change the title and/or add some more content in the description).

I'm using the following layout:

.github
    └── workflows
        ├── workflow-a.yml
        ├── workflow-b.yml
        ├── workflow-c.yml
        └── scripts
            ├── script-a.sh
            └── script-a.config.yml

In this scenario, script-a.config.yml is a config file used by script-a.sh. script-a.sh is called from workflow-a.yml.

The existence of script-a.config.yml leads to a failure of act -l with error:
Error: workflow is not valid. 'script-a.config.yml': Line: 1 Column 1: Unknown Property test

act seems to handle script-a.config.yml as a workflow file which it isn't. It's just a YAML file.

From my understanding and testing using -W doesn't make any difference as it still is the default ./.github/workflows/ in the layout shown above.

<!-- gh-comment-id:2426712027 --> @johannesmarx commented on GitHub (Oct 21, 2024): Hi @ChristopherHX, thanks for your response. Maybe I didn't manage to describe the error well enough (also happy to change the title and/or add some more content in the description). I'm using the following layout: ``` .github └── workflows ├── workflow-a.yml ├── workflow-b.yml ├── workflow-c.yml └── scripts ├── script-a.sh └── script-a.config.yml ``` In this scenario, `script-a.config.yml` is a config file used by `script-a.sh`. `script-a.sh` is called from `workflow-a.yml`. The existence of `script-a.config.yml` leads to a failure of `act -l` with error: `Error: workflow is not valid. 'script-a.config.yml': Line: 1 Column 1: Unknown Property test` `act` seems to handle `script-a.config.yml` as a workflow file which it isn't. It's just a YAML file. From my understanding and testing using `-W` doesn't make any difference as it still is the default `./.github/workflows/` in the layout shown above.
Author
Owner

@ChristopherHX commented on GitHub (Oct 21, 2024):

From my understanding and testing using -W doesn't make any difference

Ahm, -W ./.github/workflows/workflow-a.yml

Your initial issue read like .github/workflows/script-a.config.yml, therefore I never suggested --no-recurse to disable a still non existing Actions feature

The --no-recurse behavior should be the default, but .... who knows in < 1/4 year you may see this issue on GitHub.com they announced implementing it

<!-- gh-comment-id:2427583052 --> @ChristopherHX commented on GitHub (Oct 21, 2024): > From my understanding and testing using `-W` doesn't make any difference Ahm, `-W ./.github/workflows/workflow-a.yml` Your initial issue read like .github/workflows/script-a.config.yml, therefore I never suggested `--no-recurse` to disable a still non existing Actions feature The `--no-recurse` behavior should be the default, but .... who knows in < 1/4 year you may see this issue on GitHub.com they announced implementing it
Author
Owner

@johannesmarx commented on GitHub (Oct 22, 2024):

From my understanding and testing using -W doesn't make any difference

Ahm, -W ./.github/workflows/workflow-a.yml

Your initial issue read like .github/workflows/script-a.config.yml, therefore I never suggested --no-recurse to disable a still non existing Actions feature

The --no-recurse behavior should be the default, but .... who knows in < 1/4 year you may see this issue on GitHub.com they announced implementing it

Thanks a lot!

Both suggestions work:
-W: I didn't really got that you also could path a workflow file instead of a directory (was focusing to much on the default which is a directory) 👍
act --no-recurse -l: is also working 👍

<!-- gh-comment-id:2428504170 --> @johannesmarx commented on GitHub (Oct 22, 2024): > > From my understanding and testing using `-W` doesn't make any difference > > Ahm, `-W ./.github/workflows/workflow-a.yml` > > Your initial issue read like .github/workflows/script-a.config.yml, therefore I never suggested `--no-recurse` to disable a still non existing Actions feature > > The `--no-recurse` behavior should be the default, but .... who knows in < 1/4 year you may see this issue on GitHub.com they announced implementing it Thanks a lot! Both suggestions work: `-W`: I didn't really got that you also could path a workflow file instead of a directory (was focusing to much on the default which is a directory) 👍 `act --no-recurse -l`: is also working 👍
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#1147
No description provided.