Sniddl / discord-commits

Send Repository Activity using Dynamic Discord Templates
MIT License
79 stars 15 forks source link

A way to get the branch name and the commit hash #13

Closed darhal closed 3 years ago

darhal commented 3 years ago

I wonder if there is a way to access the branch name and the commit hash using the github.context.payload. I digged into the github payload documentations and couldn't find anything useful to what I'm trying to do . I would be thankful if anyone can help me with this.

ZebTheWizard commented 3 years ago

It looks like github.sha will give you the hash, and the branch name can be parsed out of the github.ref https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context