nektos / act

Run your GitHub Actions locally 🚀
https://nektosact.com
MIT License
51.8k stars 1.3k forks source link

Turning on debug logging via `ACTIONS_RUNNER_DEBUG` is not reflected in `runner.debug` context #2353

Open a-b opened 3 weeks ago

a-b commented 3 weeks ago

Bug report info

act version:            0.2.62
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
    /var/run/docker.sock
    $HOME/.docker/run/docker.sock
Config files:           
    /Users/user/.actrc:
        -P ubuntu-latest=catthehacker/ubuntu:act-latest
        -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
        -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
        -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
    Go version:            go1.22.2
    Module path:           command-line-arguments
    Main version:          
    Main path:             
    Main checksum:         
    Build settings:
        -buildmode:           exe
        -compiler:            gc
        -ldflags:             -X main.version=0.2.62
        DefaultGODEBUG:       httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
        CGO_ENABLED:          1
        CGO_CFLAGS:           
        CGO_CPPFLAGS:         
        CGO_CXXFLAGS:         
        CGO_LDFLAGS:          
        GOARCH:               amd64
        GOOS:                 darwin
        GOAMD64:              v1
Docker Engine:
    Engine version:        26.1.1
    Engine runtime:        runc
    Cgroup version:        2
    Cgroup driver:         cgroupfs
    Storage driver:        stargz
    Registry URI:          https://index.docker.io/v1/
    OS:                    Docker Desktop
    OS type:               linux
    OS version:            
    OS arch:               x86_64
    OS kernel:             6.6.26-linuxkit
    OS CPU:                16
    OS memory:             15990 MB
    Security options:
        name=seccomp,profile=unconfined
        name=cgroupns

Command used with act

act --env ACTIONS_RUNNER_DEBUG=true --workflows .github/workflows/test.yml

Describe issue

Per GHA enabling-debug-logging doc and runner-context runner's debug log status should be reflected via runner.debug expression. This behavior is not implemented in the current state of act.

Link to GitHub repository

No response

Workflow content

on:
  workflow_dispatch:
  push:
    branches: [ main ]

jobs:
  test-debug:
    name: Test Debug Workflow
    runs-on: ubuntu-latest
    steps:
      - name: Print expression details
        run: |
          echo "State of the runner.debug '${{ runner.debug }}'"
          env | grep ACTIONS_RUNNER_DEBUG

Relevant log output

| State of the runner.debug ''
| ACTIONS_RUNNER_DEBUG=true

Additional information

No response

ChristopherHX commented 2 weeks ago

IMHO, Note: --env ACTIONS_RUNNER_DEBUG=true should never work. Or show me in GitHub Actions that you can enable runner.debug via an env

I'm ok with --var ACTIONS_RUNNER_DEBUG=true or -s ACTIONS_RUNNER_DEBUG=true as a change request.

ChristopherHX commented 2 weeks ago

Isn't ${{ runner.debug }} dependent on ACTIONS_STEP_DEBUG????

a-b commented 2 weeks ago

Isn't ${{ runner.debug }} dependent on ACTIONS_STEP_DEBUG????

Very likely; it still makes sense to implement runner.debug for ACTIONS_STEP_DEBUG.