Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 1
Message 1 of 2

How to find the default variables for each github action variable

Looking at the documentation, it statest that each triggered action has a set of default variables, how do i see these default variables for each action type?

 

For example i noticed i can use this variable for a comment created action:
github.event.comment.body

 

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-va...

1 Reply
GitHub Partner
Message 2 of 2

Re: How to find the default variables for each github action variable

According to your example, if you want to get some information from github.event, github context is more suitable of your requirement . You could add this step to your workflow:

 

- name: Dump GitHub context

  env:

       GITHUB_CONTEXT: ${{ toJson(github) }}

  run: echo "$GITHUB_CONTEXT"

 

Then you can see the github json body in logs.

event-comment-body.png