A GitHub Action which can create a milestone with given title, state, description and due date. This GitHub Action is inspired by github-action-create-milestone. The action doesn't support setting due_on and state so I created another one.
This action supports following options.
The title (version) for the milestone.
- Required:
yes
- Type:
string
- Example:
v1.0.0
The state of the milestone. Either open
or closed
. Default: open
- Required:
no
- Type:
string
- Example:
open
An optional description for the milestone.
- Required:
no
- Type:
string
An optional due date for the milestone. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
.
- Required:
no
- Type:
string
Set some output data which from API response
The number of created milestone.
name: Create Milestone
on:
push:
branches:
- develop
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: develop
- name: "Set due_on"
id: set-due-on
run: echo "DUE_ON=$(date --iso-8601=seconds -d '13 days')" >> $GITHUB_ENV
- name: "Create a new milestone"
id: create-milestone
uses: oinume/create-scheduled-milestone-action@v1
with:
title: "1.0.0"
state: "open"
description: "v1.0.0"
due_on: "${{ env.DUE_ON }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "Output created milestone number"
run: echo ${{ steps.create-milestone.outputs.number }}