How to access the event that triggered a workflow

I have a workflow that is triggered each time an issue is opened. How can I access the issue number of the issue that triggered the workflow? I saw someone using 

${{ github.event.pull_request.number }}

on a forum, but I couldn’t find an equivalent syntax for issues on the docs. Here it lists the github.event context but I can’t find any specific info on issues.

You can check the context content, follow the structure to get the issue number, code as below:

echo ${{ github.event.issue.number }}

1 Like