Managing milestones: create, close and assign to pull-request
This action is designed to be triggered on repository_dispatch
events ⧉
and supports multiple events. It is not required to support all the events, each one of them can be used as a standalone.
name: Milestones
on:
repository_dispatch:
types:
- milestones_assign
- milestones_create
- milestones_close
- milestones_update
jobs:
milestones:
name: milestones
runs-on: ubuntu-latest
steps:
- uses: zattoo/milestones@v1
with:
token: ${{github.token}}
milestone: ${{github.event.client_payload.milestone}}
description: ${{github.event.client_payload.description}}
due_on: ${{github.event.client_payload.due_on}}
issue: ${{github.event.client_payload.issue}}
The workflow file have to be committed to the main
branch before it can be triggered
Parameter | Type | Description | Required |
---|---|---|---|
token |
string |
GitHub token | true |
milestone |
string |
Milestone title | true |
description |
string |
Description of the milestone | false |
due_on |
date as string |
The date which the milestone shall be due on | false |
issue |
string |
Issue to search for on pull-requests title | false |
Events can be triggered by web requests to /repos/{owner}/{repo}/dispatches
using the POST
method. read more
Used to assign a milestone to a pull-request. The action will search for pull-request which includes the issue in their title. We suggest to use zattoo/issuer for validation.
milestone
(required)issuer
(required)
{
"event_type": "assign_milestone",
"client_payload": {
"milestone": "{{issue.fixVersions.name}}",
"issue": "{{issue.key}}"
}
}
Used to create a milestone
milestone
(required)description
(optional)due_on
(optional)
{
"event_type": "create_milestone",
"client_payload": {
"milestone": "{{version.name}}",
"description": "{{version.description}}",
"due_on": "{{version.releaseDate}}"
}
}
Used to close a milestone
milestone
(required)
{
"event_type": "close_milestone",
"client_payload": {
"milestone": "{{version.name}}"
}
}
Used to update a milestone
milestone
(required)description
(optional)due_on
(optional)
{
"event_type": "update_milestone",
"client_payload": {
"milestone": "{{version.name}}",
"description": "{{version.description}}",
"due_on": "{{version.releaseDate}}"
}
}