githubgithub-actionsbuilding-github-actionsgithub-actions-workflows

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


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?


Solution

  • 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: |