[GH-ISSUE #2427] Issue when running act on a yml file #1118

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

Originally created by @lovisXII on GitHub (Aug 18, 2024).
Original GitHub issue: https://github.com/nektos/act/issues/2427

Bug report info

sudo act --bug-report
act version:            0.2.65-2-g60a2fed-dirty
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 24
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
Config files:           
        /root/.config/act/actrc:
                -P ubuntu-latest=catthehacker/ubuntu:full-latest
                -P ubuntu-22.04=catthehacker/ubuntu:full-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:full-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:full-18.04
Build info:
        Go version:            go1.23.0
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.65-2-g60a2fed-dirty
                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:               amd64
                GOOS:                 linux
                GOAMD64:              v1
Docker Engine:
        Engine version:        24.0.5
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Ubuntu Core 22
        OS type:               linux
        OS version:            22
        OS arch:               x86_64
        OS kernel:             5.15.153.1-microsoft-standard-WSL2
        OS CPU:                24
        OS memory:             15945 MB
        Security options:
                name=seccomp,profile=builtin


INFO    ️📣 A newer version of 'act' is available - consider ugrading to 0.2.65.

Command used with act

act

Describe issue

Hello,
When i run the act command in my repository it tells me my yml file is not correct and then exit.

.github/workflows
├── main.yml
└── scripts
    ├── setup.sh
    ├── symbols.yml
    └── syntax.py
    ```
    The yml file is called by syntax.py and it perfectly working so i dont get why act complains about it


### Link to GitHub repository

https://github.com/lovisXII/Klaw_CORE

### Workflow content

```yml
name: CI
on:
  push:
    branches:
      - master
      - verif/checker
jobs:
  build:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout repository
      uses: actions/checkout@v3

    - name: Cache dependencies
      uses: actions/cache@v3
      with:
        path: |
          /opt/riscv/bin/
          /usr/local/systemc-2.3.3/include/
          /usr/local/systemc-2.3.3/lib-linux64/
        key: ${{ runner.os }}-dependencies-${{ hashFiles('**/setup.sh') }}

    - name: Set up Python
      uses: actions/setup-python@v3
      with:
        python-version: '3.x'
        architecture: 'x64'

    - name: Set up virtual environment
      run: python -m venv venv

    - name: Activate virtual environment
      run: source venv/bin/activate

    - name: Set up tools
      run: |
        python -m pip install --upgrade pip
        pip install pyyaml termcolor
        if [ ! -d "/opt/riscv/bin/" ] || [ ! -d "/usr/local/systemc-2.3.3/include/" ] || [ ! -d "/usr/local/systemc-2.3.3/lib-linux64/" ]; then
          .github/workflows/scripts/setup.sh --install 1, 2
        fi

    - name: Compile RTL design
      run: ./run.py --build-only
      working-directory: ${{ github.workspace }}

    - name: Check syntax
      run: python3 .github/workflows/scripts/syntax.py
      working-directory: ${{ github.workspace }}

Relevant log output

act -v               
DEBU[0000] Handling container host and socket           
DEBU[0000] Defaulting container socket to DOCKER_HOST   
DEBU[0000] Conditional GET for notices etag=85373cbd-24a7-452a-ada9-a23fe36fff5b 
INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' 
DEBU[0000] Loading environment from /home/lovis/Klaw_CORE/.env 
DEBU[0000] Loading action inputs from /home/lovis/Klaw_CORE/.input 
DEBU[0000] Loading secrets from /home/lovis/Klaw_CORE/.secrets 
DEBU[0000] Loading vars from /home/lovis/Klaw_CORE/.vars 
DEBU[0000] Evaluated matrix inclusions: map[]           
DEBU[0000] Loading workflows from '/home/lovis/Klaw_CORE/.github/workflows' 
DEBU[0000] Loading workflows recursively                
DEBU[0000] Found workflow 'main.yml' in '/home/lovis/Klaw_CORE/.github/workflows/main.yml' 
DEBU[0000] Found workflow 'setup.sh' in '/home/lovis/Klaw_CORE/.github/workflows/scripts/setup.sh' 
DEBU[0000] Found workflow 'symbols.yml' in '/home/lovis/Klaw_CORE/.github/workflows/scripts/symbols.yml' 
DEBU[0000] Found workflow 'syntax.py' in '/home/lovis/Klaw_CORE/.github/workflows/scripts/syntax.py' 
DEBU[0000] Reading workflow '/home/lovis/Klaw_CORE/.github/workflows/main.yml' 
DEBU[0000] Reading workflow '/home/lovis/Klaw_CORE/.github/workflows/scripts/symbols.yml' 
Error: workflow is not valid. 'symbols.yml': Line: 1 Column 1: Unknown Property categories

Additional information

No response

Originally created by @lovisXII on GitHub (Aug 18, 2024). Original GitHub issue: https://github.com/nektos/act/issues/2427 ### Bug report info ```plain text sudo act --bug-report act version: 0.2.65-2-g60a2fed-dirty GOOS: linux GOARCH: amd64 NumCPU: 24 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /root/.config/act/actrc: -P ubuntu-latest=catthehacker/ubuntu:full-latest -P ubuntu-22.04=catthehacker/ubuntu:full-22.04 -P ubuntu-20.04=catthehacker/ubuntu:full-20.04 -P ubuntu-18.04=catthehacker/ubuntu:full-18.04 Build info: Go version: go1.23.0 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -X main.version=0.2.65-2-g60a2fed-dirty 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: amd64 GOOS: linux GOAMD64: v1 Docker Engine: Engine version: 24.0.5 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu Core 22 OS type: linux OS version: 22 OS arch: x86_64 OS kernel: 5.15.153.1-microsoft-standard-WSL2 OS CPU: 24 OS memory: 15945 MB Security options: name=seccomp,profile=builtin INFO ️📣 A newer version of 'act' is available - consider ugrading to 0.2.65. ``` ### Command used with act ```sh act ``` ### Describe issue Hello, When i run the act command in my repository it tells me my yml file is not correct and then exit. ``` .github/workflows ├── main.yml └── scripts ├── setup.sh ├── symbols.yml └── syntax.py ``` The yml file is called by syntax.py and it perfectly working so i dont get why act complains about it ### Link to GitHub repository https://github.com/lovisXII/Klaw_CORE ### Workflow content ```yml name: CI on: push: branches: - master - verif/checker jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Cache dependencies uses: actions/cache@v3 with: path: | /opt/riscv/bin/ /usr/local/systemc-2.3.3/include/ /usr/local/systemc-2.3.3/lib-linux64/ key: ${{ runner.os }}-dependencies-${{ hashFiles('**/setup.sh') }} - name: Set up Python uses: actions/setup-python@v3 with: python-version: '3.x' architecture: 'x64' - name: Set up virtual environment run: python -m venv venv - name: Activate virtual environment run: source venv/bin/activate - name: Set up tools run: | python -m pip install --upgrade pip pip install pyyaml termcolor if [ ! -d "/opt/riscv/bin/" ] || [ ! -d "/usr/local/systemc-2.3.3/include/" ] || [ ! -d "/usr/local/systemc-2.3.3/lib-linux64/" ]; then .github/workflows/scripts/setup.sh --install 1, 2 fi - name: Compile RTL design run: ./run.py --build-only working-directory: ${{ github.workspace }} - name: Check syntax run: python3 .github/workflows/scripts/syntax.py working-directory: ${{ github.workspace }} ``` ### Relevant log output ```sh act -v DEBU[0000] Handling container host and socket DEBU[0000] Defaulting container socket to DOCKER_HOST DEBU[0000] Conditional GET for notices etag=85373cbd-24a7-452a-ada9-a23fe36fff5b INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' DEBU[0000] Loading environment from /home/lovis/Klaw_CORE/.env DEBU[0000] Loading action inputs from /home/lovis/Klaw_CORE/.input DEBU[0000] Loading secrets from /home/lovis/Klaw_CORE/.secrets DEBU[0000] Loading vars from /home/lovis/Klaw_CORE/.vars DEBU[0000] Evaluated matrix inclusions: map[] DEBU[0000] Loading workflows from '/home/lovis/Klaw_CORE/.github/workflows' DEBU[0000] Loading workflows recursively DEBU[0000] Found workflow 'main.yml' in '/home/lovis/Klaw_CORE/.github/workflows/main.yml' DEBU[0000] Found workflow 'setup.sh' in '/home/lovis/Klaw_CORE/.github/workflows/scripts/setup.sh' DEBU[0000] Found workflow 'symbols.yml' in '/home/lovis/Klaw_CORE/.github/workflows/scripts/symbols.yml' DEBU[0000] Found workflow 'syntax.py' in '/home/lovis/Klaw_CORE/.github/workflows/scripts/syntax.py' DEBU[0000] Reading workflow '/home/lovis/Klaw_CORE/.github/workflows/main.yml' DEBU[0000] Reading workflow '/home/lovis/Klaw_CORE/.github/workflows/scripts/symbols.yml' Error: workflow is not valid. 'symbols.yml': Line: 1 Column 1: Unknown Property categories ``` ### Additional information _No response_
kerem 2026-03-01 21:49:02 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ChristopherHX commented on GitHub (Aug 19, 2024):

try act --no-recurse, something like this /home/lovis/Klaw_CORE/.github/workflows/scripts/* should be skipped.

symbols.yml is clearly not a workflow file, therefore this is a valid error if that is read as a workflow.
older versions like act release 1. August 2024 of act did forgive you passing a lot of invalid workflow definitions

I absolutly disagree that act reads .github/workflows recursively, which obviously cause your problem and GH doesn't do it.

Otherwise I wouldn't put files that are not workflows into that directory.

You could open a PR to not read them recursively, if you want to see that sooner in act.

<!-- gh-comment-id:2296899943 --> @ChristopherHX commented on GitHub (Aug 19, 2024): try `act --no-recurse`, something like this `/home/lovis/Klaw_CORE/.github/workflows/scripts/*` should be skipped. symbols.yml is clearly not a workflow file, therefore this is a valid error if that is read as a workflow. _older versions like act release 1. August 2024 of act did forgive you passing a lot of invalid workflow definitions_ I absolutly disagree that act reads `.github/workflows` recursively, which obviously cause your problem and GH doesn't do it. Otherwise I wouldn't put files that are not workflows into that directory. You could open a PR to not read them recursively, if you want to see that sooner in act.
Author
Owner

@ChristopherHX commented on GitHub (Aug 19, 2024):

It's also possible to use act -W .github/workflows/main.yml to tell act, only read a single workflow

<!-- gh-comment-id:2296902024 --> @ChristopherHX commented on GitHub (Aug 19, 2024): It's also possible to use `act -W .github/workflows/main.yml` to tell act, only read a single workflow
Author
Owner

@lovisXII commented on GitHub (Aug 19, 2024):

Indeed it worked, so without that flag act will basically analysis any .yml files ?

<!-- gh-comment-id:2297242497 --> @lovisXII commented on GitHub (Aug 19, 2024): Indeed it worked, so without that flag act will basically analysis any .yml files ?
Author
Owner

@ChristopherHX commented on GitHub (Aug 19, 2024):

without that flag act will basically analysis any .yml files ?

I think act will analyze every file under .github/workflows (default of -W).

Even .sh or other files as of now

<!-- gh-comment-id:2297281546 --> @ChristopherHX commented on GitHub (Aug 19, 2024): > without that flag act will basically analysis any .yml files ? I think act will analyze every file under `.github/workflows` (default of `-W`). Even .sh or other files as of 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#1118
No description provided.