Post

Dump the context of a github action

Github Actions documentation on specific events, e.g. “pull_request”, isn’t great. To answer questions like “where can I find the labels added to the PR that triggered the workflow”, it may be the most straightforward way to simply dump all information that the workflow receives, by dumping the github context.

You can to this within a github workflow file with this step:

1
2
3
4
- name: Dump GitHub context
  env:
    GITHUB_CONTEXT: ${{ toJson(github) }}
  run: echo "$GITHUB_CONTEXT"
This post is licensed under CC BY-ND 4.0 by the author.