lfarci / github-actions

Preparation resources for the GitHub Actions certification
0 stars 0 forks source link

Enable step debug logging in a workflow #38

Closed lfarci closed 3 months ago

lfarci commented 3 months ago

To enable step debug logging in a GitHub Actions workflow, you need to set a secret named ACTIONS_STEP_DEBUG to true in your repository. Here are the steps:

  1. Navigate to your GitHub repository.
  2. Click on the "Settings" tab.
  3. In the left sidebar, click on "Secrets".
  4. Click on the "New repository secret" button.
  5. Enter ACTIONS_STEP_DEBUG as the name and true as the value.
  6. Click on the "Add secret" button.

Now, when you run your workflow, each step will produce additional debug output in the logs.

Please note that this will enable debug logging for all workflows in your repository. If you want to enable debug logging for a specific workflow only, you can add the following step at the beginning of your workflow:

steps:
- name: Enable debug logging
  run: echo "::set-env name=ACTIONS_STEP_DEBUG::true"

This will set the ACTIONS_STEP_DEBUG environment variable to true for the rest of the workflow. However, this will only enable additional logging for the steps that run after this step.