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):

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:

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:

    runs-on: ubuntu-latest
      - name: Dump GitHub context
          GITHUB_CONTEXT: ${{ toJSON(github) }}
        run: echo $GITHUB_CONTEXT

Complete list of github actions contexts

Leave a Reply

Your email address will not be published. Required fields are marked *