How to determine which milestone was closed #25847
-
Working on an action that will run when a milestone is closed. But I currently have no way to determine which milestone the action was triggered for. Unless I missed something in the documentation. Does anyone have pointers or a way to resolve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please see https://help.github.com/en/articles/events-that-trigger-workflows#milestone-event-milestone for information on how to only trigger when the milestone is closed. As part of the context you have access to the full event payload, for milestone you can find those details in the events and payloads documentation https://developer.github.com/v3/activity/events/types/#milestoneevent. To access the milestone title, for example, you could use ${{ github.event.milestone.title }}. You can also access the payload on disk by reading the file located at $GITHUB_EVENT_PATH. |
Beta Was this translation helpful? Give feedback.
-
Cheers! Didn’t realise the entire event was available through |
Beta Was this translation helpful? Give feedback.
Please see https://help.github.com/en/articles/events-that-trigger-workflows#milestone-event-milestone for information on how to only trigger when the milestone is closed.
As part of the context you have access to the full event payload, for milestone you can find those details in the events and payloads documentation https://developer.github.com/v3/activity/events/types/#milestoneevent. To access the milestone title, for example, you could use ${{ github.event.milestone.title }}. You can also access the payload on disk by reading the file located at $GITHUB_EVENT_PATH.