-
Is it possible to get the branch name or tag ref on delete?
As per the docs, $GITHUB_REF resolves to the “default branch”, which in my case is master. I’m struggling to see how returning the default branch is more useful than resolving the actual branch or tag ref that was deleted. Is there any way to get the deleted branch name? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The event payload for delete has this infoarmtion https://developer.github.com/v3/activity/events/types/#deleteevent. You can use the github context to access data in that payload https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context |
Beta Was this translation helpful? Give feedback.
-
Just to add to this for people like me who didn’t know how to access the ref and ref_type properties for the event this is how you do it in the yaml:
|
Beta Was this translation helpful? Give feedback.
The event payload for delete has this infoarmtion https://developer.github.com/v3/activity/events/types/#deleteevent.
You can use the github context to access data in that payload https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context