Debug workflows with multiple techniques:
Enable debug logging:
- Set repository secrets:
ACTIONS_STEP_DEBUG=true,ACTIONS_RUNNER_DEBUG=true - Re-run workflow to see detailed logs
Interactive debugging:
- uses: mxschmitt/action-tmate@v3 # SSH access to runner
if: failure() # Only on failure
Local testing:
# Install act (https://github.com/nektos/act)
act -j build # Test 'build' job locally
act -l # List available jobs
Variable inspection:
- name: Debug context
run: |
echo "Event: ${{ github.event_name }}"
echo "Ref: ${{ github.ref }}"
echo "Context: ${{ toJSON(github) }}"
Use workflow_dispatch for manual triggers. Download diagnostic logs from UI. Warning: debug logs expose secrets.