Identify Issue that triggered GitHub Action within the Action

So I want to trigger an Action when I label an Issue and then create a branch based on the description of the issue.

I have the Action that is triggered by adding a Label, but I cannot find any documentation on how to identity the specific Issue that was the source of the trigger. (I am probably missing something obvious)

Is there a way to get an id/name of the GitHub object (Issue, PR, Commit, etc…) whose event triggered a specific GitHub Action?

1 Like

github.event will contain all information GitHub has on the event. It contains a label, object, which will probably contain an URL from which you can get the issue number, or that can be queried to obtain more information.

1 Like

Thanks JJ, I had some trouble getting from the gitHub.event but using the GITHUB_EVENT_PATH environment variable and reading that json file I was able to access the label object and the issue number which was the trigger for the action. I really appreciate your response through JJ, I would not have figured that out without your help :slight_smile:

1 Like