Complete list of github actions contexts
Complete list of github actions contexts
I think you want to distinguish between context variables and payloads.
Context variables are available in most cases and exceptions are documented (as you found): https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
The payload, on the other hand, depends on the event type. If you run a workflow as a result of on: pull_request
youll get a different payload than running it as a result of on: push
(etc..).
I have never seen docs that list all payloads, but I believe you can take inspiration from the webhooks. For example, if you run a workflow when a pull request is created, you could look at the webhook payload for pull requests here: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#webhook-payload-example-33
Since the two not are documented to be the same, you might have to resort back to just dumping an event and checking what you actually get. In the docs, GitHub has an example how to dump contexts as part of a workflow:
jobs:
one:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo $GITHUB_CONTEXT