How to Trigger a Workflow on a Milestone Event in GitHub Actions
The milestone event fires on milestone activity such as created, closed, opened, edited, and deleted.
Add on.milestone with the types: you care about, then read github.event.milestone to drive changelog or release-planning automation.
Steps
- Add
milestone:underonwithtypessuch as[closed]. - Read
github.event.milestone.titleanddue_on. - Kick off changelog or release-note generation.
Workflow
.github/workflows/milestone.yml
on:
milestone:
types: [closed]
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- run: echo "Milestone ${{ github.event.milestone.title }} closed"Gotchas
- Milestone events run only from the default branch, like most non-push events.
- Available types are created, closed, opened, edited, and deleted.
Related guides
How to Trigger a Workflow When a Release Is Published in GitHub ActionsRun a GitHub Actions workflow when a GitHub Release is published using on.release with the published type, id…
How to Trigger a Workflow on a Discussion in GitHub ActionsRun a GitHub Actions workflow when a GitHub Discussion is created or answered using the discussion event, for…