How to determine if the GitHub action is running with `debug logging` enabled

2.2k Views Asked by At

I'm writing a Docker-based GitHub action in Python.
I would like to add more verbosity to its output if at some point it fails and the user opts to rerun it with debug logging enabled.

So my question is: is it possible to determine it from inside of the action? Maybe some environmental variable is set automatically - or can be set manually in action.yml, or something like that?

1

There are 1 best solutions below

5
On BEST ANSWER

That info should be accessible with the runner context variable:

runner-context

so you can access like:

${{ runner.debug }}

of by condition:

  - name: debugging
    if:  runner.debug == '1'
    run: |