Debugging CI/CD Pipelines/Workflows

4.3.3. Debugging CI/CD Pipelines/Workflows#

A good approach for debugging is:

  • Debug the triggering process and the actual actions the script performs separately.

  • Choose an easy trigger to debug your Pipeline/Workflow (e.g., on push to a development branch).

  • Use echo statements to inspect variables.

Inspect context variables

jobs:
  list-github-context:
    runs-on: ubuntu-latest
    steps:
      - name: Print GitHub Context Variables
        env:
          GITHUB_CONTEXT: ${{ toJSON(github) }}
        run: |
          echo "GitHub context variables:"
          echo "$GITHUB_CONTEXT" | jq '.'