Skip to content

Latest commit

 

History

History
121 lines (88 loc) · 6.42 KB

README.md

File metadata and controls

121 lines (88 loc) · 6.42 KB

🩺 Debug Action

GitHub - marketplace GitHub - release GitHub - ci GitHub - license

This GitHub Action allows you to quickly and easily dump GitHub contexts and Runner environment and post action webhook payloads to the SMEE.io service, giving you a comprehensive overview of the current state of your GitHub workflow. This can be useful for developing, troubleshooting, debugging GitHub workflows or actions, or understanding how different components interact.

  • Action is platform-independent and tested on all the latest GitHub-hosted runners (ubuntu-latest, macos-latest, windows-latest).
  • The output of each dump is in the JSON format as much as possible.

demo

Table of Contents

🤔 Usage

Quick Start

Just place in your GitHub workflow steps:

- name: Debug
  uses: raven-actions/debug@v1

Extra contexts

By default, composite action cannot access contexts like vars, secrets needs, inputs. So if you want to include them in the dump, you must specify them explicitly. For more details, follow 📥 Inputs section.

⚠️ secrets contexts will not show your secrets in the log! It's masked *** by default.

- name: Debug
  uses: raven-actions/debug@v1
  with:
    vars-context: ${{ toJson(vars) }}  # optional
    secrets-context: ${{ toJson(secrets) }}  # optional
    needs-context: ${{ toJson(needs) }}  # optional
    inputs-context: ${{ toJson(inputs) }}  # optional

Run only when GitHub debug logging enabled

In certain circumstances (e.g., re-run failing workflow), if you'd like to run Debug Action only when GitHub debug logging is enabled, then set env on workflow or job level:

env:
  DEBUG: ${{ secrets.ACTIONS_RUNNER_DEBUG || vars.ACTIONS_RUNNER_DEBUG || secrets.ACTIONS_STEP_DEBUG || vars.ACTIONS_STEP_DEBUG || false }}

and add if: ${{ env.DEBUG == 'true' }} condition to the action.

- name: Debug
  if: ${{ env.DEBUG == 'true' }}
  uses: raven-actions/debug@v1
  with:
    vars-context: ${{ toJson(vars) }}  # optional
    secrets-context: ${{ toJson(secrets) }}  # optional
    needs-context: ${{ toJson(needs) }}  # optional
    inputs-context: ${{ toJson(inputs) }}  # optional

SMEE.io

⚠️ This feature is intended for debugging purposes only and should not be used to handle sensitive data. Additionally, please be aware that any authentication does not secure SMEE.io, and anyone with the channel ID can access your payloads.

Aid in debugging GitHub Action runs by expertly posting webhook payloads to SMEE.io.

To access the channel, please make sure you have a browser tab open to the channel URL.

- name: Debug
  id: debug
  uses: raven-actions/debug@v1
  with:
    smee: true  # optional, if not set then default is `false`
    smee-channel: my-custom-channel-name # optional, if not set then default is `repositoryOwner-repositoryName`, e.g. raven-actions-debug

- name: Debug outputs
  if: ${{ steps.debug.outputs.smee == 'true' }}  # example usage
  run: |
    echo "Your SMEE.io URL is: ${{ steps.debug.outputs.smee-url }}"

📥 Inputs

Name Required Type Default value Description
vars-context false json object not set The context for the vars must be explicitly provided, as it is unavailable in the composite actions.
secrets-context false json object not set The context for the secrets must be explicitly provided, as it is unavailable in the composite actions.
needs-context false json object not set The context for the needs must be explicitly provided, as it is unavailable in the composite actions.
inputs-context false json object not set The context for the inputs must be explicitly provided, as it is unavailable in the composite actions.
smee false bool false Aid in debugging GitHub Action runs by expertly posting webhook payloads to SMEE.io.
smee-channel false string not set If the SMEE channel ID is not provided, the ID of the repository will be utilized instead.

📤 Outputs

Name Type Description
smee-url string The SMEE URL to use. If SMEE is not used, it will be empty.

👥 Contributing

Contributions to the project are welcome! Please follow Contributing Guide.

📄 License

This project is distributed under the terms of the MIT license.